Home Download Buy Blog Forum Support

Building and Running C++ Files

Building and Running C++ Files

Postby Ash9414 on Tue Oct 09, 2012 5:16 pm

So I'm somewhat new to this, and I can't work out how to build and run my code once I've written it. Every time I go to select 'Run', this appears in the built-in console:

[Finished in 0.0s with exit code 127]bash: g++: command not found

I've selected 'C++' under 'Build System', but this doesn't seem to have any significant effect.

I'm really not too sure how to solve this.

Any help would be greatly appreciated.
Ash9414
 
Posts: 3
Joined: Tue Oct 09, 2012 5:08 pm

Re: Building and Running C++ Files

Postby skuroda on Tue Oct 09, 2012 7:28 pm

Sounds like you don't have the compiler installed. What system are you working on (you could always search for somehthing like "installing g++ on <system here>") if you don't want to wait for a forum response.
skuroda
 
Posts: 677
Joined: Fri Oct 05, 2012 8:11 am

Re: Building and Running C++ Files

Postby Ash9414 on Wed Oct 10, 2012 4:22 pm

I'm using Mac OSX Snow Leopard (10.6.8). Does the compiler not come with the Sublime Text app then?
Ash9414
 
Posts: 3
Joined: Tue Oct 09, 2012 5:08 pm

Re: Building and Running C++ Files

Postby adzenith on Wed Oct 10, 2012 4:24 pm

No, it doesn't—I'd recommend installing homebrew (http://mxcl.github.com/homebrew/) to get things like g++. Or you can install Xcode and then install its command-line tools, which homebrew itself will most likely recommend.
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: Building and Running C++ Files

Postby Ash9414 on Wed Oct 10, 2012 4:40 pm

It seems I can't download the latest version of XCode because my OS doesn't support it. So once I've downloaded Homebrew, what do I have to do to get my code to run from the Sublime Text app?
Ash9414
 
Posts: 3
Joined: Tue Oct 09, 2012 5:08 pm

Re: Building and Running C++ Files

Postby skuroda on Tue Oct 16, 2012 3:52 am

Unfortunately, I am not an OS X user so I can't be 100% sure about this. You may be able to do something like

brew install gcc

Again, I'm not 100% sure. You may try to search for the answer on the web, or wait for anther. I was a little slow to reply so you may have fixed this already.
skuroda
 
Posts: 677
Joined: Fri Oct 05, 2012 8:11 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 12 guests