Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: gregs on February 22, 2007, 12:49:37 am
-
Is there a way of forcing codeblocks to use g++ as opposed to gcc for C files?
-
Yes: Settings->Compiler and debugger->Global compiler settings->Toolchain executables.
But why exactly would you want to do that?
-
For some reason one of my libraries isn't producing the right symbols (even with extern "C") to allow it to be linked to the rest of my projects. This only seems to be a problem with gcc, as the other platforms compile happily, but they're using C++ compilers only. As it is, I'm trying to find the reason, and one of those may be incorrect namemangling, which compiling through g++ might help.
-
Even when you invoke g++ rather than gcc, the C compiler will still be used on files ending in .c. To force it to treat all files as C++, add the option "-x c++" -- but I doubt this is the correct fix for your problem, since GCC is able to link C symbols into C++ programs.
-
I agree. I found the problem, and it was just something unbelieveably simple and completely unrelated (as these things tend to be). Thank you very much for your help, especially as I didn't know the "-x c++" switch before :)