Code::Blocks Forums

User forums => Help => Topic started by: jdg on August 02, 2006, 11:28:16 pm

Title: Very odd Visual C7.1 compilation error
Post by: jdg on August 02, 2006, 11:28:16 pm
I imported a VC7.1 project file and I get the following message

cl : Command line error D2004 : '/W' requires an argument

Nothing appears in the compiler switch dialog box except /MT so I edited the cbp file and deleted all /W switches. However the message persists. It takes about 30 seconds to decide to tell me too. I have cleaned and rebuilt with zero effect.

I am using the latest stable release. as per the homepage.
Title: Re: Very odd Visual C7.1 compilation error
Post by: killerbot on August 02, 2006, 11:32:12 pm
could you try it out with a nightly build, see this forum for download links.

Ifthe problem still persists, try making your project smaller and smaller and then maybe you can post it here.
Title: Re: Very odd Visual C7.1 compilation error
Post by: jdg on August 02, 2006, 11:39:22 pm
Actually before I check with a newer version, I've now managed to get the full command line using the 'compiler logging' and i see that the /W switch is there. Is there a way to remove it?
Title: Re: Very odd Visual C7.1 compilation error
Post by: killerbot on August 02, 2006, 11:53:21 pm
check if it has not showed up in the other options in the compiler settings.
But really upgrade to a nightly ;-)
Title: Re: Very odd Visual C7.1 compilation error
Post by: jmccay on August 03, 2006, 01:27:21 am
   I do suggest setting up a nightly build version.  It is worlds better.  It's been a while since I looked at RC2, but I have a couple of suggestings.

   First, did you look in both the Project & Compiler settings (i.e. the global compiler setting and the project build options)?  I can't remember if RC2 has  these, but I felt it was worth mentioning.

   As for the error, it's not really that odd, /W does reqiure an argument (for VC++ 2005: /Wall,  /W1,  /W2,  /W3,  /W4,  /WL,  /Wp64,  /WX).  My guess is that you have it set somewhere (maybe by default).

jmccay
Title: Re: Very odd Visual C7.1 compilation error
Post by: tdliles on September 06, 2006, 09:02:11 pm
I am getting the same error message: /W requires an argument.  Has anybody figured out where it's coming from??  I can not find it in any Project or Compiler settings.  Currently using MS C++ Toolkit 2003 with the Aug 30 nightly build.  And I did import a MS project.  Thanks for any guidance!
Title: Re: Very odd Visual C7.1 compilation error
Post by: tdliles on September 06, 2006, 09:27:10 pm
This is what I'm seeing from the full command line:  cl.exe /nologo -W -fexceptions -O2 -DWIN32 -DNDEBUG -D_WINDOWS -D_APP_LIB  /I.........

In the Advanced Options for the compiler, the Command line macro:  $compiler /nologo $options $includes /c $file /Fo$object

Therefore the $options variable is generating:  -W -fexceptions -O2 -DWIN32 -DNDEBUG -D_WINDOWS -D_APP_LIB

I can't find any of these options set anywhere.  Where are the 'default' options coming from??  Thanks.
Title: Re: Very odd Visual C7.1 compilation error
Post by: quickhot on October 10, 2011, 10:41:01 am
Yes, I have the SAME ERROR. So any one can tell me where to get rid of the '/W'? Whatever you check the "Disable all warnings [/w] ...[w1][w2]..." or not, it is still say that ....  :(
Title: Re: Very odd Visual C7.1 compilation error
Post by: kijoshua on July 17, 2012, 03:38:25 pm
workaround:  Settings->Compiler->Global compiler settings->Other settings->Advanced options...
(Other settings is the tab hidden off the window, have to scroll it...)

delete that wacky $options part of the Command line macro.  I have no clue where it comes from, but it adds the "-W" which breaks things.  It also adds a "-O0" I think, but that only throws a warning about how it is an unknown option.

The downside is that you won't have the options from the compiler settings page applied anymore.  So I'd recommend setting the options you want first, copying the command line, then replacing the command line macro with the result after removing the bugs manually.

Decided to give CB a try, and this was one of the many immediate problems that smacked me in the face...  Using the latest nightly, this bug (or perhaps poor design) still exists...  6 years later...
Title: Re: Very odd Visual C7.1 compilation error
Post by: xorcist on May 15, 2017, 12:19:04 pm
found a fix... that will take care of this situation.

go to Projects->Build options

Select the project root name
(not Win32 Release or Win32 Debug)

Select Compiler Settings->Other Compiler Options

looks like these GCC compiler flags got copied over from using the GCC compiler.  Remove them they're invalid.

-march=i686
-fomit-frame-pointer
-O3
-Wredundant-decls
-Wundef
-Wmissing-declarations
-Wmissing-include-dirs
-Wmain
-Wall
-std=c++98
-m32
/Og
Title: Re: Very odd Visual C7.1 compilation error
Post by: sodev on May 15, 2017, 06:32:26 pm
Thank you for your effort to sign up just to answer this question. I have one question though: why did it take almost 9 years?

Sign up process too difficult? Question too hard? Bonus points: Where can you get this ancient compiler? Are current compilers still affected by that? Is the current CodeBlocks still affected by that?