Author Topic: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'  (Read 12042 times)

Offline whisp

  • Single posting newcomer
  • *
  • Posts: 3
Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
« 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
« Last Edit: January 20, 2014, 10:27:43 pm by whisp »

Offline whisp

  • Single posting newcomer
  • *
  • Posts: 3
Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
« Reply #1 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.
« Last Edit: January 20, 2014, 10:26:59 pm by whisp »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
« Reply #2 on: January 20, 2014, 11:00:13 pm »
If you execute the same command in the console, do you still receive the warning?

Offline whisp

  • Single posting newcomer
  • *
  • Posts: 3
Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
« Reply #3 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.
« Last Edit: January 21, 2014, 12:01:37 am by whisp »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
« Reply #4 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Linking with the VC 11.0 linker: unrecognized option '/DEBUG'
« Reply #5 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.  I will see if I can come up with a proper patch soon.