Results 1 to 4 of 4

Thread: problems with linking.... ??

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default problems with linking.... ??

    Hi,

    I had a programm with 2 forms. This all worked. Now i tried to move the code and the form into a dll. When compiling and linking now, i get error LNK2001.

    The complete output is here :

    ------ Build started: Project: logconsole, Configuration: Debug Win32 ------

    Deleting intermediate files and output files for project 'logconsole', configuration 'Debug|Win32'.
    Moc'ing logconsole.h...
    Uic'ing logconsole.ui...
    Compiling...
    logconsole.cpp
    c:\Qt\4.1.3\include\QtCore\arch\../../../src\corelib\arch\windows\arch\qatomic.h(131) : warning C4311: 'reinterpret_cast' : pointer truncation from 'void *' to 'long'
    c:\Qt\4.1.3\include\QtCore\arch\../../../src\corelib\arch\windows\arch\qatomic.h(131) : warning C4311: 'reinterpret_cast' : pointer truncation from 'void *' to 'long'
    c:\Qt\4.1.3\include\QtCore\arch\../../../src\corelib\arch\windows\arch\qatomic.h(131) : warning C4312: 'reinterpret_cast' : conversion from 'long' to 'void *' of greater size
    c:\Qt\4.1.3\include\QtCore\arch\../../../src\corelib\arch\windows\arch\qatomic.h(143) : warning C4311: 'reinterpret_cast' : pointer truncation from 'void *' to 'long'
    c:\Qt\4.1.3\include\QtCore\arch\../../../src\corelib\arch\windows\arch\qatomic.h(143) : warning C4312: 'reinterpret_cast' : conversion from 'long' to 'void *' of greater size
    Microsoft Compiler detected
    Linking...
    Creating library ..\..\..\..\exe/lib/logconsole.lib and object ..\..\..\..\exe/lib/logconsole.exp
    logconsole.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const LogConsole::staticMetaObject" (?staticMetaObject@LogConsole@@2UQMetaObject@@B)
    logconsole.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall LogConsole::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@LogConsole@@UAEHW4Call@QMetaObject@@ HPAPAX@Z)
    logconsole.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall LogConsole::qt_metacast(char const *)" (?qt_metacast@LogConsole@@UAEPAXPBD@Z)
    logconsole.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall LogConsole::metaObject(void)const " (?metaObject@LogConsole@@UBEPBUQMetaObject@@XZ)
    ..\..\..\..\exe\logconsole.dll : fatal error LNK1120: 4 unresolved externals

    Build log was saved at "file://d:\Cvs_data\trash\BuildLog.htm"
    logconsole - 5 error(s), 5 warning(s)


    ---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped

    I have no idea where to start looking for a solution. Tried the form here... saw stuff about linking towards qtmain.lib QtCore4.lib instead of the qtmaind.lib QtCore4d.lib but this didnt have any effect.

    its qt 4.1.3 wit vs2003.

    The form that uses slots/signals needs to have the Q_OBJECT, the other form doesnt. Removing the Q_OBJECT on the form that doesnt need the slots/signals results in an dll that does in fact link. But where is the problem ????

    Any ideas ?
    Last edited by jacek; 31st July 2006 at 16:45. Reason: change [ code ] to [ quote ] to allow wrapping

Similar Threads

  1. static & dynamic linking
    By mickey in forum General Programming
    Replies: 6
    Last Post: 11th June 2010, 08:57
  2. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39
  3. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  4. Replies: 4
    Last Post: 20th February 2006, 09:11
  5. Replies: 3
    Last Post: 30th January 2006, 15:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.