Page 1 of 2

Linker warnings in Debug x64 build /MT

Posted: Thu Jul 12, 2018 12:44 pm
by _NN_
Debug x64 platform:
I have project with Multithreaded CRT (/MT not /MD).
The project compiled in Debug with the madCHook mt lib get following:

Code: Select all

1>LIBCMTD.lib(initializers.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
Another issue with Debug Win32 platform:

Code: Select all

1>madCHook32.lib(madCHook.obj) : warning LNK4202: spawning full build due to '/INCREMENTAL:NO' directive
1>madCHook.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification

Re: Linker warnings in Debug x64 build /MT

Posted: Wed Jul 18, 2018 8:06 am
by madshi
I hate MSVC++, so many stupid linker problems. Are these warnings a real big problem, or is it just a cosmetical issue?

Re: Linker warnings in Debug x64 build /MT

Posted: Wed Jul 18, 2018 11:08 am
by _NN_
If you switch from EditAndContinue to simple PDB and turn off incremental linking, there is no warning.
It just the project default ;)

Re: Linker warnings in Debug x64 build /MT

Posted: Wed Jul 18, 2018 12:03 pm
by madshi
Ah I see, that should be easy enough! :)

Re: Linker warnings in Debug x64 build /MT

Posted: Thu Jul 19, 2018 12:24 pm
by madshi
So here's a new test build:

http://madshi.net/madCollectionBeta.exe

It now contains 32bit static libs created with MSVC++ (2005). I didn't actually find a setting for "incremental linking", when creating lib files. The 32bit static lib you've been working with is created from the Delphi sources, by using some external conversion tools. Maybe those tools made it appear as if the static lib were built with "incremental linking"? I've no idea.

P.S: The new build also contains the new DLL injection method as an option. See USE_IAT_DLL_INJECTION. It requires your hook DLL to have an exported function, though, otherwise it won't work. And the biggest disadvantage: Uninjection no longer works, because the OS considers your hook DLL statically linked.

Re: Linker warnings in Debug x64 build /MT

Posted: Thu Sep 20, 2018 9:11 am
by _NN_
Hello,
I tried the new libs and get a about 32 warnings in 32-bit build:

Such as:
madCHook32mt.lib : warning LNK4099: PDB 'vc80.pdb' was not found with 'madCHook32mt.lib(AtomicMove.obj)' or at 'bin\vc80.pdb'; linking object as if no debug info

Workaround advanced setting for linker: /ignore:4099


The original warning still present.
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
Workaround: Use /NODEFAULTLIB:LIBCMT as described here.
https://docs.microsoft.com/en-us/cpp/er ... ew=vs-2017

UI
Image

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 8:27 am
by madshi
Do you get the same warnings when compiling the madCodeHook demo projects?

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 10:27 am
by _NN_
Demo projects don't have Debug build configuration.

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 10:31 am
by madshi
True. Hmmmm... I'm not exactly sure what to do now, to be honest. MSVC++ with its countless compiler and linker incompatability issues like this is annoying the heck out of me.

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 10:41 am
by _NN_
There are only few little issues which are not hard to solve.
As well there are workarounds for all of them except this one.
Perhaps you should add documentation page with all workarounds to not search the forum each time.

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 10:47 am
by madshi
Any suggestions on how to solve this one?

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 11:39 am
by _NN_
The warning says that one or more of your files are compiled with a different flag.
For instance all files use /MT but one uses /MD.
Is it true ?

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 2:20 pm
by madshi
A user requested a while ago that I provide both MT and MD builds. So I'm doing that (for the static libs created with MSVC++). The lib files have "MT" or "MD" in the file name. The file name should match how I created them (I hope).

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 2:45 pm
by _NN_
Check the initializers.cpp file. Perhaps something weird there.
Check with VS2017, the warning reproduces easily.

Re: Linker warnings in Debug x64 build /MT

Posted: Tue Sep 25, 2018 2:46 pm
by madshi
"initializers.cpp"? I don't have such a file here.