User forums > Help

gcc finds errors in cstdlib when compiling my code in C::B - why?

(1/2) > >>

mark1977:
Hi,

As soon as I start a new (let's say empty) project choosing the GNU GCC Compiler, the project opens this file:

c:\MinGW\lib\gcc\mingw32\4.6.1\include\c++\cstdlib

Which is strange. Then I add files to the project and attempt to build, but I get this error:

c:\mingw\bin\..\lib\gcc\mingw32\4.6.1\include\c++\cstdlib|176|error: '::llabs' has not been declared|

I have tried to compile from the command line using gcc and my own makefile - everything is fine. I'm using Windows 7 and Code::Blocks 10.05.

Is this something to do with C::B's include directories...? Any ideas?

Thanks,

Mark

stahta01:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

mark1977:
Thanks for the link, I enabled full command line and it didn't give any indication that CB was using any unusual include directories.

The problem seems to be the include line

#include <cstdlib>

Again I stress that this doesn't occur from the command line using g++. Does anybody know whereabouts I can look in CB's to see if it's doing anything suspicious?

Thanks,

Mark

oBFusCATed:
The full log is this place. You see the exact commands it is executing.
If you execute them in a terminal they will fail with the same errors.

Please check your toolchain settings, because there is a chance they are wrong.
Also if you have two mingw versions, one in x:\mingw and the other in some other place, they might interfere, because mingw has hardcoded paths to x:\mingw.

mark1977:
The exact command is:

g++.exe -Wall -fexceptions  -g     -c "C:\Users\local admin\codes\CKat2\HydroLa\CPP\SetParam.cpp" -o obj\Debug\HydroLa\CPP\SetParam.o

I can't run this in a terminal because it doesn't recognise obj as part of a path. But I can run the first part:

g++.exe -Wall -fexceptions  -g     -c "C:\Users\local admin\codes\CKat2\HydroLa\CPP\SetParam.cpp"

Which compiles fine.

My toolchain paths are fine:

C:\MinGW

with everything in the usual \bin place...

Navigation

[0] Message Index

[#] Next page

Go to full version