User forums > Help

C++ error Codeblocks

(1/1)

rajatkhanduja:
I've been using C:B for C files/projects ... but only recently i began using it for C++ as well

Even the simplest of programs can't be compiled..although using terminal commands, I can compile the program..

despite checking that g++ is used (at least according to the settings), i still get the following in Build code....notice the "gcc"


--- Quote ---
-------------- Build: Debug in C++ ---------------

gcc  -o bin/Debug/C++ obj/Debug/try.o   -pg 
obj/Debug/try.o: In function `__static_initialization_and_destruction_0':
/usr/include/c++/4.4/iostream:72: undefined reference to `std::ios_base::Init::Init()'
/usr/include/c++/4.4/iostream:72: undefined reference to `std::ios_base::Init::~Init()'
obj/Debug/try.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings
 [/tt]

--- End quote ---

Please help

oBFusCATed:
In the project tree right click the *.cpp files -> properties -> advanced -> compiler variable should be CPP (it is CC I suppose)

Jenna:
What is the file-ending ?
If it is not cpp or cxx, but c, codeblocks assumes that it is a c-file and uses gcc instead of g++.

Navigation

[0] Message Index

Go to full version