i meet the same problem like http://forums.next.codeblocks.org/index.php/topic,12950.0.html
But when i check my .cbp file .i found i didnot make the same mistake with him/her.So i need your help.
i use ubuntu 10.04 ,and codeBlocks version is 10.05.when i create console project with gcc whicn only prints hello,world,but each time I hit run, a dialog box appears saying "It seems that this project has not been built yet. Do you want to build it now?". I click yes, the project builds successfully.Hit execute again, then a dialog box appears again saying "It seems that this project has not been built yet. Do you want to build it now?". but when i click on yes,it shows nothing at all.
when i open /projectname/obj/debug ,i found main.o.Then i run" gcc -o main.o a" in the console, it works well. The .cbp file is in the attachment .Forgive my poor English and thank you for helping me solve the problem.
Works fine here with your project file (C::B 10.05svn6441, debian 64bit unstrable/experimental, gcc 4.4).
What does the build log say (if you try to run your program) ?
Quote from: jens on August 02, 2010, 11:44:06 PM
Works fine here with your project file (C::B 10.05svn6441, debian 64bit unstrable/experimental, gcc 4.4).
What does the build log say (if you try to run your program) ?
thank you for reply. the build log says:"
Linking console executable: bin/Release/test7
/bin/sh: g++: not found
Process terminated with status 127 (0 minutes, 0 seconds)
0 errors, 0 warnings
"
it says g++ not found,but the project created is using c language and it produced main.o
file .i check the compile and debug settings .The selected compiler is gnu gcc compiler and compiler's installation directory tab in tool-chain executables is /usr(auto check).
g++ can link both c and c++ projects, so C::B uses it for both.
To change that go to Settings -> Compiler & Debugger -> Compiler -> Toolchain executables
Quote from: oBFusCATed on August 03, 2010, 09:19:51 AM
g++ can link both c and c++ projects, so C::B uses it for both.
To change that go to Settings -> Compiler & Debugger -> Compiler -> Toolchain executables
You have two options: either use gcc for linkiung, but be aware, that you will get errors when you later switch to c++, because gcc can not link c++ objects
or install also g++, even if you do not use c++ at the moment.
I recommend the second option.
Offtopic: I've always wandered why the c and c++ compilers are not separated as two compilers.
I've added some global options to the compiler that are c++ only and when I compile C project (oneof the C::B projects is written in C) I get warnings "-fsomething is not available in C mode" or something like that.
p.s. I know the answer (or at least one of the aswers) -> to be able to have c and c++ code in one project.
Quote from: jens on August 03, 2010, 09:57:34 AM
Quote from: oBFusCATed on August 03, 2010, 09:19:51 AM
g++ can link both c and c++ projects, so C::B uses it for both.
To change that go to Settings -> Compiler & Debugger -> Compiler -> Toolchain executables
You have two options: either use gcc for linkiung, but be aware, that you will get errors when you later switch to c++, because gcc can not link c++ objects
or install also g++, even if you do not use c++ at the moment.
I recommend the second option.
thank you ,i did as the second one. i change g++ to g++-4.4 in the toolchain executables,and i works.thank you for your help
I could resolve this problem doing the next:I installed the synaptic. Logged in as sudo, type: apt-get install synaptic. Type in the search field: g++. With the right button, mark "select for install", then press "mark". After that, press apply. Open the Codeblocks and test.