[Interest] qmake bug. Any workaround?

Alexander Dyagilev alervdvcw at gmail.com
Fri Jan 15 15:54:25 CET 2021


Hello,

I am trying to create a .pro file to compile Microsoft Detours lib.

Failed, it generates linker error:

detours.obj:-1: error: LNK2019: unresolved external symbol 
DetourCopyInstruction referenced in function DetourAttachEx

This function is defined in disasm.cpp in case there are no special 
defines existing.

But, there are disolarm.cpp disolarm64.cpp disolia64.cpp disolx64.cpp 
disolx86.cpp sources which defines platform-depended definitions and 
then includes this disasm.cpp.

E.g. disolarm.cpp contains of only these 2 lines of code:
#define DETOURS_ARM_OFFLINE_LIBRARY
#include "disasm.cpp"

In this case disasm.cpp defines DetourCopyInstructionARM instead of 
DetourCopyInstruction.

Qmake has the bug (https://bugreports.qt.io/browse/QTBUG-24906) which 
causes qmake to DROP disasm.cpp from SOURCES because it's included in 
these source files . Thus plain DetourCopyInstruction is not defined 
anywhere.

If I replace #include "disasm.cpp" lines with file's content, all works 
fine. But this is not a workaround I want.

Is there one which can be used in a real project? Why is this ugly bug 
not fixed yet (8 years has passed)?



More information about the Interest mailing list