Author Topic: C++ error Codeblocks  (Read 3995 times)

rajatkhanduja

  • Guest
C++ error Codeblocks
« on: June 13, 2010, 11:31:48 am »
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]

Please help

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: C++ error Codeblocks
« Reply #1 on: June 13, 2010, 11:42:36 am »
In the project tree right click the *.cpp files -> properties -> advanced -> compiler variable should be CPP (it is CC I suppose)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Re: C++ error Codeblocks
« Reply #2 on: June 13, 2010, 12:00:22 pm »
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++.