C++ Compiler for Mac Leopard that is NOT Xcode?

In summary: If you want to use a different compiler on your Windows machine, you can download and install the gcc compiler from the link given at the start of the summary. There is also a link to an XCode project file for a Hello World program. You can simply modify the source files and press the "compile and run" button to generate and run the program.
  • #1
Saladsamurai
3,020
7
I am a novice (very novice) C++ user. I use Dev C++ on my PC. I really love it because it is very clean and simple. I just click File->new->new source code and I am there. There is an editing window and a building workspace is opened automatically.

Is there something comparable to Dev C++ for Macs? I tried Xcode and so far I hate it.

Just looking for some (free) alternatives.

Any thoughts?

Thanks,
Casey
 
Technology news on Phys.org
  • #3
Rootx, I don't think that would be very helpful to salad's situation.

Saladsamurai: If you have xcode installed then you also have gcc installed. (This is basically the only compiler out there for os x, so anything else you download will just be a shell for gcc. There probably do exist such shells-- macvim?-- but I wouldn't know what they are.) If you want to compile something with gcc, just open a terminal window and say:

g++ yourfilename.cpp -o yourprogramname

However if you are doing any kind of "real" (i.e. GUI) application development you want to use XCode because it does stuff like framework linking for you.

If you don't like XCode you don't have to interact with it very much. Just find an XCode project file suitable to your situation, modify the source files, and pretend XCode itself doesn't exist other than the 'compile and run' button.
 
  • #4
Basically anything that runs on Linux should be available for OS-X, the other common IDE is Eclipse http://www.eclipse.org/
As coin says the actual compiler is generally the excellent gcc
 
  • #5
Thanks for the suggestions guys. I guess I really do not know what I am talking about. And it is even harder for me to explain what it is I do not like since I do not know the lingo at all.

mgb: You helped me track down Dev C++. Have you used it? I basically just want to be able to open a new source file and write some some crappy code and then execute it.

I have been going into Xcode and selectingFile-->New project-->(on command line utility tab) C++ tool.


Then I get a little lost. I have to save the project as something, which creates a Folder.

then this window comes up

Picture2-13.png


Then I select "main.cpp" and this comes up:

Picture3-9.png


and for some reason that stupid "Hello World" program always opens under main.cpp


I think that is there as some kind of a template. It is created everytime I open a new project.

When I run it...no terminal comes up. I have to toggle back to this screen, and select the file with the black icon named "Untitled"

Picture2-13.png


Though, now the word "Untitled" is black since there is some code that has been built.
After clicking it, this piece of crap of a terminal comes up and displays the output:


Picture4-3.png



Maybe I am just being a baby since I am so used to Dev C++ and now I have to get used to this.

I hate that terminal window. I need to figure out if there is a way to change the default colors and if it is necessary for all that garbage to come up with it (i.e., everything except "Hello World").
 
  • #6
Saladsamurai said:
Thanks for the suggestions guys. I guess I really do not know what I am talking about.

Essentially, yes. XCode is a superb IDE, second only to Visual Studio in my opinion. For what it's worth, I didn't like XCode much when I first encountered it either. Perseverance pays off though.

Saladsamurai said:
When I run it...no terminal comes up. I have to toggle back to this screen, and select the file with the black icon named "Untitled"

Unfortunately I'm typing this on a Windows machine and, given that I've had a beer or two, can't vouch for the accuracy of what I'm about to say. However, pressing Command-B (or maybe it's Command-Shift-B) should build and run the project for you. Since the default contents of main.cpp are just a simple Hello World app, this should pop up a console window in which the application runs.


Saladsamurai said:
After clicking it, this piece of crap of a terminal comes up and displays the output:

You've just compiled and run the source code to Hello World. What, precisely, do you expect? Doom 3?

Saladsamurai said:
I hate that terminal window. I need to figure out if there is a way to change the default colors and if it is necessary for all that garbage to come up with it (i.e., everything except "Hello World").

Command-, gives you access to preferences in OS X. Change your terminal settings via that!
 
  • #7
After clicking it, this piece of crap of a terminal comes up and displays the output:
Thats the good part, on windows it would just pop up a window behind the IDE somewhere and immediately close it after the program had run before you could see anything

If you just want to learn c without using the ide you can just run gcc on the commandline.
 
Last edited:
  • #8
Quick question, if I may butt in: Is the Xcode version of gcc much different from the regular GNU gcc? I am a Mac noob wanting to compile C on a Mac OS X. I've only ever written code when I absolutely have had to, and those times, I was using gcc on a linux machine.
 
  • #9
Depends exactly which version of GCC installs with xcode. But no there is no difference in the same version of GCC running on different platforms.
The libraries will be differnet of course to handle the different OS.
 
  • #10
Saladsamurai said:
I basically just want to be able to open a new source file and write some some crappy code and then execute it.

If that's all you want to do, you don't need no steenkin' fancy-pants IDE. :devil:

Just fire up the Terminal application (in the Applications:Utilities folder) and do the following (what you type is in boldface):

Code:
[yourmac:~] yourname% [B]pico hello.cpp[/B]

This fires up a simple text editor. Enter your source code, then hit ^X to exit.

Code:
[yourmac:~] yourname% [B]g++ hello.cpp -o hello[/B]

This compiles your code, links it to the standard library, and places the executable in the file 'hello'.

Code:
[yourmac:~] yourname% [B]./hello[/B]
Hello, world!

When you get to the point of breaking up your program into lots of separate source files and having to compile and link them together, or you have to use lots of nonstandard libraries (e.g. if you start writing Mac OS GUI applications), that's when an IDE like Xcode starts to save you time. But for basic C++ coursework programs, it's overkill.
 
Last edited:
  • #11
Saladsamurai said:
I am a novice (very novice) C++ user. I use Dev C++ on my PC. I really love it because it is very clean and simple. I just click File->new->new source code and I am there. There is an editing window and a building workspace is opened automatically.

Is there something comparable to Dev C++ for Macs? I tried Xcode and so far I hate it.

Just looking for some (free) alternatives.

Any thoughts?

Thanks,
Casey

I feel your pain i was in you same situation 2years ago when i got a mac. What i would recommend is codeblocks. Its just as good as VS and in my opioion it is better than Dev-C++.

http://www.codeblocks.org/downloads/5#mac
 
  • #12
Hi Tacoma,

That's interesting, does Code::Blocks have a native mac interface or does it run in the X Server?

Also does Code::Blocks have any special features for supporting wxWindows development, if one is interested in doing that?
 
  • #13
Code::Blocks is crap even on Windows; why anyone would recommend the appalling OS X version is beyond me.

(And Code::Blocks is "just as good as [Visual Studio]"? Even allowing for a truly enormous number of vacua, I doubt there's a universe in which that's the case. :wink:)
 
  • #14
shoehorn said:
Code::Blocks is crap even on Windows; why anyone would recommend the appalling OS X version is beyond me.

(And Code::Blocks is "just as good as [Visual Studio]"? Even allowing for a truly enormous number of vacua, I doubt there's a universe in which that's the case. :wink:)

Your not the first person who has told me this. I Code::Blocks appeals to me more for some reason. Is good how ever I am not a .net developer, I am an open source deveplover so cross-platform support is more ideal.

However you have to realize that he said he was beginner and you have to agree that using code::blocks is easier than using Xcode and faster than elipse.
 

Related to C++ Compiler for Mac Leopard that is NOT Xcode?

1. What is the difference between a C++ compiler for Mac Leopard and Xcode?

A C++ compiler for Mac Leopard is a standalone software that is used specifically for compiling C++ code on a Mac operating system. Xcode, on the other hand, is a comprehensive development environment that includes a C++ compiler as well as other tools for building and debugging software on Mac, iOS, and other Apple platforms.

2. Can I use a C++ compiler for Mac Leopard instead of Xcode for developing iOS apps?

No, a C++ compiler for Mac Leopard is not suitable for developing iOS apps. Xcode is the only officially supported development environment for building iOS apps, as it includes additional tools and libraries specifically designed for iOS development.

3. Is a C++ compiler for Mac Leopard free to use?

It depends on the specific compiler you are using. Some C++ compilers for Mac Leopard are free and open-source, while others may require a license for commercial use. It is important to check the licensing terms before using any compiler.

4. Can I install multiple C++ compilers for Mac Leopard on my computer?

Yes, you can install multiple C++ compilers for Mac Leopard on your computer. However, you will need to set up your development environment to use the specific compiler you want to use for each project.

5. Does using a C++ compiler for Mac Leopard guarantee that my code will be compatible with all Mac operating systems?

Not necessarily. While a C++ compiler for Mac Leopard can help ensure that your code is compatible with the Mac operating system, it does not guarantee compatibility with all versions of Mac. It is important to test your code on different operating systems to ensure compatibility.

Similar threads

  • Programming and Computer Science
Replies
1
Views
3K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
29
Views
2K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
9
Views
3K
  • Computing and Technology
Replies
5
Views
1K
  • Programming and Computer Science
Replies
6
Views
3K
  • Programming and Computer Science
Replies
6
Views
9K
  • Programming and Computer Science
Replies
12
Views
11K
Back
Top