Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 9

Qt-interest Archive, March 2002
Use of plugins in own software


Message 1 in thread

 Dear list,

 i use Qt 3.0.3 with MS C++ 6.0 on Windows.

 I tried out the QWidgetPlugin example for the Qt-Designer, which works very
 well. Then I want to use the
 plugin in an example program for my own. Here I get lots of problems, which
 i can't solve.
 Perhaps I misunderstood something in the docs?
     "Once the plugin has been compiled it will automatically be found and
loaded by Qt Designer the next time
      Qt Designer is run. Use your custom widget just like any other. If you
want to use the plugin in another of
      your projects you can link against it by adding an appropriate line to
the project, e.g. by adding a line like
      this to the project's .pro file:

     LIBS += filechooser.lib"

 I've wrote a small testprogram:

 // FileChooser is the qt-example with some extensions, i need

#include <qapplication.h>
 #include <filechooser.h>

 using namespace mach;

 int main( int argc, char ** argv )
 {
  QApplication a( argc, argv );

  FileChooser *fc = new FileChooser("Filename");
  fc->setMode(FileChooser::FileOpen);
  fc->setCaption("Das ist ein Test");
  fc->setFilter("All files (*.*)\nImages (*.xpm)");

  a.setMainWidget(fc);

  fc->show();

  return a.exec();
}

 This is the .pro file:

 SOURCES    += mainplugin.cpp
 HEADERS    += s:\mach\include\filechooser.h
 LIBS       += $(QTDIR)\plugins\designer\filechooser.lib
 TARGET      = filechooser
 TEMPLATE    = app
 CONFIG     += qt warn_on release
 DBFILE      = filechooser.db
 PROJECTNAME = FileChooser
 LANGUAGE    = C++

 I always get the following linker errors:

link /NOLOGO delayimp.lib /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll
/DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll
/SUBSYSTEM:windows /OUT:filechooser.exe
mainplugin.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public:
void __thiscall mach::FileChooser::setFilter(class QString const &)"
(?setFilter@FileChooser@mach@@QAEXABVQString@@@Z)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"public: void __thiscall mach::FileChooser::setFilter(class QString const
&)" (?setFilter@FileChooser@mach@@QAEXABVQString@@@Z)
mainplugin.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public:
void __thiscall mach::FileChooser::setMode(enum mach::FileChooser::Mode)"
(?setMode@FileChooser@mach@@QAEXW4Mode@12@@Z)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"public: void __thiscall mach::FileChooser::setMode(enum
mach::FileChooser::Mode)" (?setMode@FileChooser@mach@@QAEXW4Mode@12@@Z)
mainplugin.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public:
__thiscall mach::FileChooser::FileChooser(class QString const &,class
QWidget *,char const *)"
(??0FileChooser@mach@@QAE@ABVQString@@PAVQWidget@@PBD@Z)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"private: void __thiscall mach::FileChooser::selectFile(void)"
(?selectFile@FileChooser@mach@@AAEXXZ)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"public: void __thiscall mach::FileChooser::setFileName(class QString const
&)" (?setFileName@FileChooser@mach@@QAEXABVQString@@@Z)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"public: void __thiscall mach::FileChooser::setLabel(class QString const &)"
(?setLabel@FileChooser@mach@@QAEXABVQString@@@Z)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"public: class QString  __thiscall mach::FileChooser::fileName(void)const "
(?fileName@FileChooser@mach@@QBE?AVQString@@XZ)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"public: class QString  __thiscall mach::FileChooser::label(void)const "
(?label@FileChooser@mach@@QBE?AVQString@@XZ)
moc_filechooser.obj : error LNK2001: Nichtaufgeloestes externes Symbol
"public: enum mach::FileChooser::Mode  __thiscall
mach::FileChooser::mode(void)const "
(?mode@FileChooser@mach@@QBE?AW4Mode@12@XZ)
filechooser.exe : fatal error LNK1120: 9 unaufgeloeste externe Verweise

I don't have any idea, what is going wrong here.
If  i link the filechooser.obj to this program and not the lib everything
works allright.
I hope, you can help me.

Thanks Christian

mailto:christian.matzke@hochtief.de or christian.matzke@t-online.de
>
>