Qt made static library linker error
I am trying to include a 3rd party Qt made static library in my Qt project thread. Whenever I instantiate an instance of the class, however, I get the following linker error:
Quote:
Error 1 error LNK2005: "public: __thiscall QString::QString(char const *)" (??0QString@@QAE@PBD@Z) already defined in QtCored4.lib(QtCored4.dll) c:\Source\QT4_Core\PMD Monitor\PmdClientApi.lib 1
And about a hundred more just like that. All having to do with QString.
Re: Qt made static library linker error
Please, don't double post and use [code] tags only for code snippets.
Re: LNK2005 Static library
How can I delete an old post when I put it on the wrong forum? If I knew how, I wouldn't have double-posted.
Re: LNK2005 Static library
Quote:
Originally Posted by
TheGrimace
How can I delete an old post when I put it on the wrong forum? If I knew how, I wouldn't have double-posted.
You can't delete posts. If your post was in a wrong section, I would move it.
The problem is that you have two Qt implementations, the one inside that static library and the one you link your application with. Both of them define the same symbols and linker doesn't know which one to choose. If you link that 3rd party library with Qt dynamically (with the same version you use), the problem should go away. But I don't know if there is some solution that would allow you to leave that library untouched.
Re: LNK2005 Static library
Do you mean editing the header files to point at my local Qt before the included lib? Or something else?
Thank You!
Re: LNK2005 Static library
Quote:
Originally Posted by
TheGrimace
Do you mean editing the header files to point at my local Qt before the included lib? Or something else?
No, you have to recompile that 3rd party library.
Re: LNK2005 Static library
Thank You for your assistance