You are not logged in.

1

Wednesday, July 21st 2010, 7:14pm

Linking error when linking to my plugin lib

I´m very new to Qt and I wanted to do a new plugin just for testing and know how.

The platform is visual studio 2008 with the add-in and Qt4.5 compiled as shared lib (dynamic).

The plugin is just a label, an edit box and a slider inheriting from QWidget and drawn with Designer, with one or two custom slots.

I´m having no problems to make the plugin being shown in designer, the problem is that when I try to use it in a program I´m unable to link.

I´m having the files (dll, lib and exp) in $(QTDIR)\plugins\designer, and the linker pointing to the plugin lib file, with the maximum verbose setting I can see that there is no problem with that, I´m starting to think that it can be a problem of the import library generated in the plugin project.

The result is that the constructor is not found to be linked.(the next linker info is not complete because the verbose option gives to much info).

Quoted

1> Found __load_config_used
1> Loaded MSVCRT.lib(loadcfg.obj)
1>Searching C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\OLDNAMES.lib:
1>Searching C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\msvcprt.lib:
1>Searching C:\Users\Yo\Programacion\Lib\Qt\4.5\lib\qtmain.lib:
1>Searching C:\Users\Yo\Programacion\Lib\Qt\4.5\lib\QtCore4.lib:
1>Searching C:\Users\Yo\Programacion\Lib\Qt\4.5\lib\QtGui4.lib:
1>Searching C:\Users\Yo\Programacion\Lib\Qt\4.5\lib\QtSolutions_MFCMigrationFramework-2.8d.lib:
1>Searching C:\Users\Yo\Programacion\Lib\Qt\4.5\plugins\designer\QtSliderGroup.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\kernel32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\user32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\gdi32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\winspool.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\comdlg32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\advapi32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\shell32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\ole32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\oleaut32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\uuid.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbc32.lib:
1>Searching C:\Program Files\Microsoft SDKs\Windows\v6.0A\\lib\odbccp32.lib:
1>Finished searching libraries
1>moc_qvst.obj : error LNK2019: unresolved external symbol "public: __thiscall QtSliderGroup::QtSliderGroup(class QWidget *)" (??0QtSliderGroup@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_Form::setupUi(class QWidget *)" (?setupUi@Ui_Form@@QAEXPAVQWidget@@@Z)
1>D:\Users\Yo\Programacion\Src\VS2008Projects\VST\QtVstTemplateProject\Release\QtVstTemplateProject.dll : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\Users\Yo\Programacion\Src\VS2008Projects\VST\QtVstTemplateProject\QtVST\Release\BuildLog.htm"
1>QtVstTemplateProject - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The code of the plugin is:

qtslidergroup.h

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef QTSLIDERGROUP_H
#define QTSLIDERGROUP_H

#include <QtGui/QWidget>
#include <QtGlobal>
#include <RafaLib/Parameters/parameterinterface.hpp>

namespace Ui
{
class SliderGroup;
};

class QtSliderGroup : public ParameterInterface
{
Q_OBJECT

Q_PROPERTY(quint32 ID READ getID WRITE setID);

public:

QtSliderGroup(QWidget *parent = 0);
virtual ~QtSliderGroup();

virtual void intInternalValueChanged(qint32 value)
{
emit intValueChange(value,this->getID());
};

virtual void stringInternalValueChanged(QString value)
{
 emit stringValueChange(value,this->getID());
};

virtual void setString(const QString& str) ;
virtual void setValue(quint32 value);
virtual void setLabel(const char* val);

private:
Ui::SliderGroup* ui;
};

#endif // QTSLIDERGROUP_H


parameterinterface.hpp

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef PARAMETERINTERFACE_H
#define PARAMETERINTERFACE_H

#include <QtGui/QWidget>
#include <QtGlobal>

class ParameterInterface : public QWidget
{
Q_OBJECT
Q_PROPERTY(quint32 ID READ getID WRITE setID)

protected slots:
 
virtual void intInternalValueChanged(qint32 value) = 0;
virtual void stringInternalValueChanged(QString value) = 0;

signals:

 void intValueChange(qint32 value, quint32 element);
 void stringValueChange(QString value, quint32 element);

public:

ParameterInterface(QWidget *parent = 0):QWidget(parent){};
virtual ~ParameterInterface(){};

virtual void setValue(quint32 value) = 0;
virtual void setString(const QString& str) = 0;
virtual void setLabel(const char* val) = 0;
quint32 getID() const {return this->elID;};
void setID(quint32 ID){this->elID = ID;};

//protected:


private:

quint32 elID; 
};

#endif


qtslidergroup.hpp

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "qtslidergroup.h"
#include "ui_QtSliderGroup.h"

QtSliderGroup::QtSliderGroup(QWidget *parent)
	: ParameterInterface(parent)
{
	ui = new Ui::SliderGroup();
	ui->setupUi(dynamic_cast<QWidget*>(this));	
	connect(ui->slider,SIGNAL(valueChanged),this,SLOT(intValueChanged));
	connect(ui->edit,SIGNAL(editValue), this, SLOT(stringValueChanged));
	this->show();
}

QtSliderGroup::~QtSliderGroup()
{
  delete ui;
}

void QtSliderGroup::setLabel(const char* val)
{
	ui->label->setText(QString(val));
}

void QtSliderGroup::setString(const QString& str)
{
	ui->edit->setText(str);
}

void QtSliderGroup::setValue(quint32 value)
{
	ui->slider->setValue(value);
}

The qtsliderplugin.h and qtsliderplugin.cpp are default generated by the add-in.

I did try for 3 hours with no solution and search the forum just in case something like this happened, it should be something very minor but I need ideas because im stuck.

This post has been edited 1 times, last edit by "rafa1981" (Jul 21st 2010, 7:19pm)


2

Friday, July 30th 2010, 10:21am


Rate this thread