Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Doubly defined symbols while porting from 5.6 to 5.9



  • I am porting my application from Qt version 5.6.0 (msvc2015 32Bit) to 5.9.5 (msvc2017 64 Bit).
    I have a lib which replaces the new and delete operator with my own version. In Qt 5.6 this does not led to any problem. But in Qt 5.9 this results in a linker error
    *libTracing.lib(memops.obj) : error LNK2005: "void __cdecl operator delete(void )" (??3@YAXPEAX@Z) ist bereits in MSVCRT.lib(delete_scalar.obj) definiert.
    I use qmake (and qtcreator) to build my program. I see, that the linker is called with qtmain.lib before my own libTracing.lib (this is identical in qt5.6 and qt5.9.5). If I manually put qtmain.lib after my lib the linker does not report any problem. But I can't find an option to control the sequence of qtmain and my own lib via qmake.
    What can I do in this situation?


  • Lifetime Qt Champion

    Hi,

    That's a question you should rather bring to the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.


Log in to reply