Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Greatwolf on September 11, 2010, 09:32:12 am
-
When I right click on a .cpp file in my workspace and pick 'Build File', it gives me in the build log:
Execution of 'cl.exe /nologo /Od /Zi /I"C:\Program Files\Microsoft SDKs\Windows\v6.0A\include" /I"G:\Microsoft Visual Studio 9.0\VC\include" /c main.cpp /Foobj\Debug\main.obj' in 'G:\footest' failed.
But when I do a project build/rebuild it works just fine. Any ideas what's wrong? This happens with VC toolchain and GCC toolchain. Oddly enough, Borland toolchain does not exhibit this problem.
Did anyone run into this issue before?
-
Are you talking about Visual Studio or Code::Blocks? Because I'm confused from your description...
In case you are talking about VS, please read the rules of this forum and expect a moderator to lock / disable this topic.
-
This is C::B using the VS toolchain obviously
-
Just to add to this info, I found that if I duplicate the build target and set it the compiler toolchain to be different from the project root toolchain, requesting a single file build will actually generate an uncaught exception crashing C::B.
The nightly build I am using is svn 6271 May 22 btw.
Thanks
-
How serendipitous!! I was just coming here to report this same issue. I've done a bit of tinkering and discovered the issue.
If the current target uses a different compiler than that which was chosen when the project was created, then using the Build menu option "Compile current file" or its shortcut (ctrl-shift-F9) or right-click + "Build file" in the Management pane results in an "Execution of 'compiler' in 'project' failed." message. The likely cause is that that specific routine does not use the proper executable paths (e.g. searches for bcc32.exe in the gcc path.) The full "Build" (ctrl-F9 or right-click project) command works as expected. I tested with 3 projects using different initial compilers with additional build targets using diverse compilers. Each time, the only "Compile current file" that was correct was for the initial compiler. I also tested simply changing the compiler for the "default" targets and the same issue arises; "Compile current file" fails while "Build" succeeds.