Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Code Blocks Won't work on Mac

Okay, so I'm taking an Intro to C class and I cannot get my Code Blocks compiler to work. I've installed Command Line tools for Xcode and I also have Xcode. However, the installation for the OSX 10.7.5 software update won't seem to work. I keep getting the following message:


file://localhost/Users/alyssacastelli/Desktop/Screen%20Shot%202013-02-04%20at%20 9.40.36%20AM.png



I have a simple "hello world" code in Code Blocks and when I hit "build and run", all I get is this:

___________________________________________________________

gcc -c "/Users/alyssacastelli/Desktop/C Programming Files/alyssahello.c" -o "/Users/alyssacastelli/Desktop/C Programming Files/alyssahello.o"

g++ -o "/Users/alyssacastelli/Desktop/C Programming Files/alyssahello" "/Users/alyssacastelli/Desktop/C Programming Files/alyssahello.o"

Process terminated with status 0 (0 minute(s), 1 second(s))

0 error(s), 0 warning(s) (0 minute(s), 1 second(s))


Checking for existence: /Users/alyssacastelli/Desktop/C Programming Files/alyssahello

Executing: osascript -e 'tell app "Terminal"' -e 'activate' -e 'do script "/Users/alyssacastelli/Desktop/C Programming Files/alyssahello"' -e 'end tell' /Users/alyssacastelli/Downloads/CodeBlocks.app/Contents/MacOS/cb_console_runner (in /Users/alyssacastelli/Desktop/C Programming Files)

Process terminated with status 0 (0 minute(s), 2 second(s))

____________________________________________________________


I've been trying to get this thing to work for years. I've taken it to my professor several times as well as a few of the other mac users in my class with no success. If someone here can figure this out, that would be great. Thanks.

MacBook Pro, Mac OS X (10.7.5), Code Blocks compiler and Xcode

Posted on Feb 4, 2013 6:58 AM

Reply
Question marked as Best reply

Posted on Jan 19, 2017 1:43 PM

I realize that this is an old post but it may help others.


I just completely uninstalled and re-installed CodeBlocks-13.12 for Mac.

I created a New Project from the File menu and clicked on the Run button.

It compiled fine but no console appeared, just like the Original Poster described!


I launched the Terminal (/Applications/Utilities/Terminal) just to make sure it worked.

That's all I did. Thereafter, CodeBlocks worked fine.


So, if you've never launched the Terminal, you apparently need to launch it once

after installing CodeBlocks for CodeBlocks to work properly. There might be an

an explanation but it seems inconvenient that it doesn't work the first time.

(Also, you need to disable two user-contributed plugins: keyboard shortcuts and

code completion.)


Hope this helps someone.

16 replies
Question marked as Best reply

Jan 19, 2017 1:43 PM in response to RohithSunny

I realize that this is an old post but it may help others.


I just completely uninstalled and re-installed CodeBlocks-13.12 for Mac.

I created a New Project from the File menu and clicked on the Run button.

It compiled fine but no console appeared, just like the Original Poster described!


I launched the Terminal (/Applications/Utilities/Terminal) just to make sure it worked.

That's all I did. Thereafter, CodeBlocks worked fine.


So, if you've never launched the Terminal, you apparently need to launch it once

after installing CodeBlocks for CodeBlocks to work properly. There might be an

an explanation but it seems inconvenient that it doesn't work the first time.

(Also, you need to disable two user-contributed plugins: keyboard shortcuts and

code completion.)


Hope this helps someone.

Feb 4, 2013 8:53 AM in response to alyssabritt

Google search results tell me that "Codeblocks is a cross-platform IDE built around wxWidgets, designed to be extensible and configurable. Runs on Windows and Linux"


Why on earth would you ever use such a thing? Is this a requirement for the class? You don't want it.


If this is a requirement for the class, you might be able to get Codeblocks from MacPorts or something. You could build it yourself, but you would have to learn a bit about Xcode and other stuff first - the catch-22 of open source.


But to reiterate, you don't want to use Codeblocks for anything. It is a waste of your time. If it is required for this class, drop the class and find another one.

Jan 19, 2017 11:55 AM in response to Irbin B.

1. Hmm, it's possible that your keybindings (on your Mac) have been previously set.

Open System Preferences (click the Apple symbol at top left of your screen).

Click the keyboard icon, then the Shortcuts tab. There is a Restore Defaults

button. You can look through the various categories but Keyboard seems the

most relevant. Perhaps clicking Restore Defaults will solve the problem.


2. Check again that you have actually disabled the two mis-behaving plugins.


3. Are you using a US keyboard? Just a thought but some keyboards have different

keycode mappings. You can search the internet for ways to remap the keyboard.


4. Copy/paste - this seems a bit extreme but it can get you through in a pinch.

Find an example of square brackets on the internet and copy them into a handy

place (like in a comment at the top of your program). Then, whenever you need

them, copy them into place.


5. Search the internet (stackexchange, for example) for others who are reporting

a similar problem with the Code::Blocks IDE for C++ programming. This is not

the same problem as the original poster reported.

Feb 4, 2013 7:36 AM in response to alyssabritt

Update to the 2-January-2013 12.11-SP1 Code::Blocks release for OS X. Have you shared this issue on the Code::Blocks forum or with them directly? Have you tried to compile your code on another platform in Code::Blocks?


You might want to post this over on the developer area in the Apple Support Community.


Whatever happened to the legacy compilation sequence:


gcc -O2 -o alyssahello alyssahello.c

Jun 5, 2014 6:23 PM in response to alyssabritt

I've been using both CodeBlocks and Xcode on Mac for a couple of years.

Xcode is great for developing Mac applications.

CodeBlocks is great if you need a cross-platform IDE.


I'll outline the steps I used to get it working (fairly simple).


1. Get CodeBlocks version 12.11


Don't go here:

http://www.codeblocks.org/downloads (note: 13.12 is known to have a problem on Mac).


Instead, go here:

http://sourceforge.net/projects/codeblocks/files/Binaries/12.11/


Click on MacOS and get the .dmg (unless you're more comfortable with .zip).

Read the comments below the download options.


2. After download and installation, drag CodeBlocks.app into your ~/Applications folder.


3. Start CodeBlocks and disable a couple of plugins that cause problems.


Click Menu->Plugins, then Plugin Manager.

The plugins are alphabetized. Find the following and disable them.

command completion

keyboard shortcuts


Examining your screenshot a little closer, I suspect you may not have selected Console Application.

You can check by clicking Menu->Project->Properties, Build targets. Find "Type:" in the

"Selected build target options" section. It should say "Console application". If it doesn't,

change it and click "OK".


I don't recall having to do anything else. Create a project (Hello world) and run.

Please report whether this solves your problem - thanks.

Code Blocks Won't work on Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.