Author Topic: Code::Blocks in Mac OSX, error in Terminal: "can't execute bianry file."  (Read 7515 times)

Offline Blocks4moi

  • Single posting newcomer
  • *
  • Posts: 4
 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks in Mac OSX, error in Terminal: "can't execute bianry file."
« Reply #1 on: December 04, 2009, 06:35:45 am »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Blocks4moi

  • Single posting newcomer
  • *
  • Posts: 4
Re: Code::Blocks in Mac OSX, error in Terminal: "can't execute bianry file."
« Reply #2 on: December 11, 2009, 02:56:46 am »
Thanks. Yes, I had to install the gnu compiler and that fixed it.