Hello,

Because of some issues i had with a customer, i decided to link my applications as a static set of libraries. For this project, i'm working with Windows XP Pro, Qt 4.7.1 OpenSource and Visual Studio 2008 (With the VSAddIn). Therefore i have compiled Qt in a separated folder (C:/Qt/4.7.1/Static) by changing a few files in the mkspecs as explained in the Trolltech doc.

Then, i have changed my VS projects configuration to link against QtCore.lib / QtCoreb.lib instead of QtCore4.lib / QtCore4.lib, and so on for each required library (QtMain, QtCore, QtGui, QtNetwork, etc). i also have changed the runtimes for /MD in release and /MDd in debug.

One of my application compiles fine, and runs. Another one doesn't. The only difference i can see between those two is that the one not compiling links against QtNetwork, the other not.

Here comes my linker's log:
Qt Code:
  1. 1>main.obj : warning LNK4217: locally defined symbol ??1QCoreApplication@@UAE@XZ (public: virtual __thiscall QCoreApplication::~QCoreApplication(void)) imported in function _main
  2. 1>main.obj : warning LNK4217: locally defined symbol ?exec@QCoreApplication@@SAHXZ (public: static int __cdecl QCoreApplication::exec(void)) imported in function _main
  3. 1>main.obj : warning LNK4217: locally defined symbol ?connect@QObject@@SA_NPBV1@PBD01W4ConnectionType@Qt@@@Z (public: static bool __cdecl QObject::connect(class QObject const *,char const *,class QObject const *,char const *,enum Qt::ConnectionType)) imported in function _main
  4. 1>main.obj : warning LNK4217: locally defined symbol ?qFlagLocation@@YAPBDPBD@Z (char const * __cdecl qFlagLocation(char const *)) imported in function _main
  5. 1>OCRServerWorker.obj : warning LNK4217: locally defined symbol ?qFlagLocation@@YAPBDPBD@Z (char const * __cdecl qFlagLocation(char const *)) imported in function "public: void __thiscall OCRS::OCRServerWorker::processSharedMemoryBlock(class QString const &)" (?processSharedMemoryBlock@OCRServerWorker@OCRS@@QAEXABVQString@@@Z)
  6. 1>main.obj : warning LNK4217: locally defined symbol ??0QCoreApplication@@QAE@AAHPAPAD@Z (public: __thiscall QCoreApplication::QCoreApplication(int &,char * *)) imported in function _main
  7. 1>main.obj : warning LNK4217: locally defined symbol ??1QTcpServer@@UAE@XZ (public: virtual __thiscall QTcpServer::~QTcpServer(void)) imported in function __unwindfunclet$??0OCRServer@OCRS@@QAE@PAVQObject@@@Z$0
  8. 1>main.obj : warning LNK4217: locally defined symbol ??0QMutex@@QAE@W4RecursionMode@0@@Z (public: __thiscall QMutex::QMutex(enum QMutex::RecursionMode)) imported in function "public: __thiscall OCRS::OCRServer::OCRServer(class QObject *)" (??0OCRServer@OCRS@@QAE@PAVQObject@@@Z)
  9. 1>main.obj : warning LNK4217: locally defined symbol ??0QTcpServer@@QAE@PAVQObject@@@Z (public: __thiscall QTcpServer::QTcpServer(class QObject *)) imported in function "public: __thiscall OCRS::OCRServer::OCRServer(class QObject *)" (??0OCRServer@OCRS@@QAE@PAVQObject@@@Z)
  10. 1>main.obj : warning LNK4217: locally defined symbol ??1QHostAddress@@QAE@XZ (public: __thiscall QHostAddress::~QHostAddress(void)) imported in function "public: void __thiscall OCRS::OCRServer::start(void)" (?start@OCRServer@OCRS@@QAEXXZ)
  11. [... Hundreds of lines like this ...]
To copy to clipboard, switch view to plain text mode 

Any help will greatly be appreciated

Thanks a lot,
Pierre.