Code::Blocks Forums

User forums => Help => Topic started by: whisp on January 19, 2014, 10:08:24 pm

Title: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
Post by: whisp on January 19, 2014, 10:08:24 pm
When building my project i get the following warning:
LINK||warning LNK4044: unrecognized option '/DEBUG'; ignored|

Recently i switched from MinGW GCC to the VC 11.0 compiler. I didn't have the selection in the Code::Blocks compiler list, so i copied the Microsoft Visual C++ 2010 Compiler settings and replaced the "10.0" in the directories (e.g. the compiler installation directory) with "11.0". Compiling works fine, but when linking i get the above mentioned warning. /DEBUG is the linker flag of the preset Code::Blocks compiler flag "Produce debugging symbols /Zi" and officially an option of the VC 11.0 linker (http://msdn.microsoft.com/en-us/library/y0zzbyt4%28v=vs.110%29.aspx).

From the build log:
Code
cl.exe /nologo /EHs /W3 /Zi    /I"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include" /I"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include" /c helper.cpp /Foobj\Debug\helper.obj
link.exe /lib /nologo /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib" /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib" /out:bin\Debug\libHelper.lib  obj\Debug\helper.obj  /DEBUG
helper.cpp
LINK : warning LNK4044: unrecognized option '/DEBUG'; ignored

Code::Blocks SVN 9455.

Anyone has a clue how i can get this to work (without just removing it)? Any hints appreciated.

whisp
Title: Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
Post by: whisp on January 20, 2014, 10:18:11 pm
Anyone who can confirm this as a Code::Blocks problem for VC 11.0? Or, in contrary, that he uses the VC 11.0 linker in Code::Blocks without this problem? Thanks!

Btw, i'm using SVN 9455.
Title: Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
Post by: Alpha on January 20, 2014, 11:00:13 pm
If you execute the same command in the console, do you still receive the warning?
Title: Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
Post by: whisp on January 20, 2014, 11:57:54 pm
Thanks for that hint. I just tried it in the windows command console and got the same error.

It turned out that the problem isn't the /DEBUG option, despite the error message, but the /lib option. It is not an option of VC 11.0 link.exe and if i use the /dll option instead (respectively set the build target type in Code::Blocks to dynamic library) it works fine. I don't know which option is needed to create a static library, yet.

According to http://msdn.microsoft.com/en-us/library/y0zzbyt4%28v=vs.100%29.aspx it's neither an option for the VC 10.0 linker.
Title: Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
Post by: oBFusCATed on January 21, 2014, 12:39:08 am
Thanks for that hint. I just tried it in the windows command console and got the same error.
It is not an error, but a warning it is a bit different.
Title: Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
Post by: Alpha on January 21, 2014, 01:26:06 am
[...] I don't know which option is needed to create a static library, yet.
According to http://msdn.microsoft.com/en-us/library/y0zzbyt4%28v=vs.100%29.aspx it's neither an option for the VC 10.0 linker.
It looks like we are suppose to be using lib.exe (http://msdn.microsoft.com/en-us/library/7ykb2k5f.aspx).  I will see if I can come up with a proper patch soon.