Question:
I just made a new C++ file in Code::Blocks 10.05 and it isn't working! 10 Points to the Person who helps me!!?
David612
2012-02-13 20:34:15 UTC
I am running a Mac on Snow leopard. I am trying to run the Hello world program that is already prewritten. But when I try to run and compile it, it keeps coming up with this error "Starting out - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping..." (in blue) then the next line goes "Nothing to be done" (in black) Any guesses on whats wrong I downloaded it straight from the Code::Blocks website and I was watching a tutorial. The only thing that was different is that I am running a mac and he is running a windows. Could someone please email me or answer this question and help me. Because I am behind in my C++ programming class and I am trying to work with this tutorial
http://www.youtube.com/watch?v=tvC1WCdV1XU&feature=BFa&list=PLAE85DE8440AA6B83&lf=plpp_video
IF you could help that would be fantastic! Thanks
Three answers:
t
2012-02-13 22:36:44 UTC
You need to get GCC (the GNU Compiler Collection). The easiest way to do that is to install Xcode (Apple's IDE), which should come with all the compilers and debuggers Code::Blocks requires. Create a free Apple Developer account at https://developer.apple.com/programs/register/ , then download Xcode from https://developer.apple.com/xcode/ .



If you managed to install Xcode (and hence GCC) correctly, you should be able to compile source code by opening the terminal and typing "g++ SourceFile.cpp". Once you know GCC is working, open Code::Blocks and try to get it to recognize GCC (if it doesn't detect GCC automatically you'll have to go to the settings and specify which toolchain to use under Settings->Compiler and Debugger->Global Compiler settings->Toolchain executables).



Still can't get Code::Blocks to work? Use Xcode. You shouldn't have any problems with Xcode because it's an Apple product designed for Macs, unlike Code::Blocks.





Edit:

Replace SourceFile.cpp with the name of the source code file you want to compile. For example, make a text file called "HelloWorld.cpp" with the following content:



#include

int main()

{

printf("Hello World\n");

return 0;

}



To compile it,

- open the terminal

- use "cd" to navigate to the file's directory

- compile it using "g++ HelloWorld.cpp"

- this should create a file called "a.out" or similar

- run it by typing "./a.out"
Jared
2012-02-13 21:15:31 UTC
This is somewhat difficult to answer. I don't have a mac. Did you set up the compiler path correctly? Usually at some point you need to setup a compiler. On my windows machine, I had both the MinGW suite and MSVC++ and had to tell it which compiler to use. I don't know how deep you are going into c++ but i'll assume it's somewhat of a beginner course since you're having difficulty setting up and IDE.



Since you are on a Mac, you install the supplied compiler and use the terminal instead.



Code::Blocks for Mac does says at the bottom, that it is not as stable as other ports due to lack of mac developers in the project. You might want to ask on the Code::Blocks forum and see what others did. Sorry I don't have anymore information
matlack
2016-12-10 23:32:02 UTC
Code Blocks 10.05 Free Download


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...