Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Need help with release mode import issues (windows)
This is only happening in release mode, debug mode is fine.
I am linking in a C DLL into to my C++ DLL and for whatever reason when I look at my C DLL entry in Dependency Walker the import section for that DLL is full of invalid imports, infact it is listing all the imports from the next DLL listed in dependency walker. I am unable to run the program, it gives me the error that said DLL can not find an entry point; the entry point listed is not used by the DLL at all. If I look at the C DLL directly in Depends all looks fine, its only when it gets linked into my code in release mode. Hopefully that is not too confusing to follow. Any ideas? Any additional info I can provide?
Ive been comparing the compile out put of my debug vs. release modes and I noticed /INCREMENTAL:NO in my release builds. How can I enable incremental builds in my release builds? I tried adding CONFIG += incremental as described here http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#config (search "incremental") but it made no difference.
The second part to this, is if this works then why? The C DLL btw, is compiled using MinGW and is using a .def file for its exports if that helps any. Thanks!
Ok, i found this worked:
QMAKE_LFLAGS_RELEASE += /INCREMENTAL
Question now is around helping me understand why an incremental build would break the build. Looking at MS's docs I see that an incremental build:
Is larger than a nonincrementally linked program because of padding of code and data. (Padding allows the linker to increase the size of functions and data without recreating the .exe file.)
May contain jump thunks to handle relocation of functions to new addresses.
I suspect the 2nd one, relocation of functions is breaking this C DLL; any insight as to why? Or maybe just some links to point me to "linking for idiots"? :)