Linker warnings in Debug x64 build /MT

c++ / delphi package - dll injection and api hooking

Linker warnings in Debug x64 build /MT

Postby _NN_ » Thu Jul 12, 2018 12:44 pm

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
_NN_
 
Posts: 48
Joined: Mon Jan 21, 2013 4:00 pm

Re: Linker warnings in Debug x64 build /MT

Postby madshi » Wed Jul 18, 2018 8:06 am

I hate MSVC++, so many stupid linker problems. Are these warnings a real big problem, or is it just a cosmetical issue?
madshi
Site Admin
 
Posts: 9784
Joined: Sun Mar 21, 2004 5:25 pm

Re: Linker warnings in Debug x64 build /MT

Postby _NN_ » Wed Jul 18, 2018 11:08 am

If you switch from EditAndContinue to simple PDB and turn off incremental linking, there is no warning.
It just the project default ;)
_NN_
 
Posts: 48
Joined: Mon Jan 21, 2013 4:00 pm

Re: Linker warnings in Debug x64 build /MT

Postby madshi » Wed Jul 18, 2018 12:03 pm

Ah I see, that should be easy enough! :)
madshi
Site Admin
 
Posts: 9784
Joined: Sun Mar 21, 2004 5:25 pm

Re: Linker warnings in Debug x64 build /MT

Postby madshi » Thu Jul 19, 2018 12:24 pm

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.
madshi
Site Admin
 
Posts: 9784
Joined: Sun Mar 21, 2004 5:25 pm

Re: Linker warnings in Debug x64 build /MT

Postby _NN_ » Thu Sep 20, 2018 9:11 am

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
_NN_
 
Posts: 48
Joined: Mon Jan 21, 2013 4:00 pm

Re: Linker warnings in Debug x64 build /MT

Postby madshi » Tue Sep 25, 2018 8:27 am

Do you get the same warnings when compiling the madCodeHook demo projects?
madshi
Site Admin
 
Posts: 9784
Joined: Sun Mar 21, 2004 5:25 pm

Re: Linker warnings in Debug x64 build /MT

Postby _NN_ » Tue Sep 25, 2018 10:27 am

Demo projects don't have Debug build configuration.
_NN_
 
Posts: 48
Joined: Mon Jan 21, 2013 4:00 pm

Re: Linker warnings in Debug x64 build /MT

Postby madshi » Tue Sep 25, 2018 10:31 am

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.
madshi
Site Admin
 
Posts: 9784
Joined: Sun Mar 21, 2004 5:25 pm

Re: Linker warnings in Debug x64 build /MT

Postby _NN_ » Tue Sep 25, 2018 10:41 am

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.
_NN_
 
Posts: 48
Joined: Mon Jan 21, 2013 4:00 pm

Re: Linker warnings in Debug x64 build /MT

Postby madshi » Tue Sep 25, 2018 10:47 am

Any suggestions on how to solve this one?
madshi
Site Admin
 
Posts: 9784
Joined: Sun Mar 21, 2004 5:25 pm

Re: Linker warnings in Debug x64 build /MT

Postby _NN_ » Tue Sep 25, 2018 11:39 am

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 ?
_NN_
 
Posts: 48
Joined: Mon Jan 21, 2013 4:00 pm


Return to madCodeHook

Who is online

Users browsing this forum: ExPx and 7 guests