News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Code::Blocks in Mac OSX, error in Terminal: "can't execute bianry file."

Started by Blocks4moi, December 03, 2009, 11:31:44 PM

Previous topic - Next topic

Blocks4moi

 Help in using Code::Blocks in Mac OSX. I'm barely starting to study programming and I can't seem to be able to run my first "Hello World" program. This is my code:

#include <iostream>

using namespace std;

int main()

{

cout << "Hello World !" << endl;

}


And the Terminal says unable to execute binary file. I tried to Build and Run the code but it wouldn't. It just won't run on Mac OS. The same code builds and runs on my desk top running Code::Blocks on Ubuntu. Can anyone help me get started? I will appreciate a lot any help you can give me.

MortenMacFly

C::B is an IDE, not a compiler. C::B supports quite a list of compiler natively (and can be easily extended). So: You not only need C::B, but also a compiler framework of your choice (which should be supported by C::B, of course). Install yourself a compiler framework!
If in doubt enable full compiler logging (see my sig) and post the FULL log that appears when you try to compile your application.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Blocks4moi

Thanks. Yes, I had to install the gnu compiler and that fixed it.