User forums > Using Code::Blocks

It seems that this project has not been built yet. Do you want to build it now?

(1/2) > >>

hbucius:
i meet the same problem like http://forums.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.
 

Jenna:
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) ?

hbucius:

--- 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) ?

--- End quote ---
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).

oBFusCATed:
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

Jenna:

--- 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

--- End quote ---
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.

Navigation

[0] Message Index

[#] Next page

Go to full version