User forums > Using Code::Blocks
Implicit switch to C compiler?
smallB:
When I tried to create precompiled header following: http://wiki.codeblocks.org/index.php?title=Precompiled_headers
I started getting following error:
||warning: command line option '-Weffc++' is valid for C++/ObjC++ but not for C [enabled by default]|
||warning: command line option '-std=c++0x' is valid for C++/ObjC++ but not for C [enabled by default]|
C:\metaprogramming_excersizes\trying_c_compiler_not_in_toolchain\pr.h|6|error: C++ style comments are not allowed in ISO C90|
||=== Build finished: 1 errors, 2 warnings (0 minutes, 0 seconds) ===|
This project compiled before those steps from the link. Doesn't won't to compile after even though compiler is set to be C++ compiler. Is this a bug in Code::blocks or I'm doing something wrong?
oBFusCATed:
Read this: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
smallB:
Hi, I've read that already and cannot find anything relevant in there, can you?
oBFusCATed:
Hm, have you enabled the full log? I don't see the real errors in the log. Do you have .c files?
smallB:
Hi this is the entire log from the compilation of a project:
Build started on: 24-10-2011 at 16:28.26
Build ended on: 24-10-2011 at 16:28.27
-------------- Build: Debug in trying_c_compiler_not_in_toolchain ---------------
mingw32-gcc-4.6.1.exe -Wall -fexceptions -g -Wshadow -Winit-self -Wredundant-decls -Wcast-align -Wundef -Wfloat-equal -Winline -Wunreachable-code -Wmissing-declarations -Wmissing-include-dirs -Wswitch-enum -Wswitch-default -Weffc++ -Wmain -pedantic-errors -pedantic -std=c++0x -Wfatal-errors -Wextra -Wall -g -ID:\Libraries\boost_1_47_0\boost_1_47_0 -IC:\metaprogramming_excersizes\trying_c_compiler_not_in_toolchain -IC:\metaprogramming_excersizes\trying_c_compiler_not_in_toolchain -c C:\metaprogramming_excersizes\trying_c_compiler_not_in_toolchain\pr.h -o pr.h.gch
cc1.exe: warning: command line option '-Weffc++' is valid for C++/ObjC++ but not for C [enabled by default]
cc1.exe: warning: command line option '-std=c++0x' is valid for C++/ObjC++ but not for C [enabled by default]
C:\metaprogramming_excersizes\trying_c_compiler_not_in_toolchain\pr.h:6:8: error: C++ style comments are not allowed in ISO C90
compilation terminated due to -Wfatal-errors.
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 2 warnings (0 minutes, 0 seconds)
The entire project looks like this:
#include <iostream>
using namespace std;
#include "pr.h"
int main()
{
cout << "Hello world!" << endl;
return 0;
}
#ifndef PR_H_INCLUDED
#define PR_H_INCLUDED
/*Nothing in this file, not even this comment*/
#endif // PR_H_INCLUDED//here cb shows the erroneous line (because of the comment)
No, I do not have .c files.
Navigation
[0] Message Index
[#] Next page
Go to full version