Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bursty

macrumors 65816
Original poster
Jan 31, 2004
1,002
5
I am forced to take a basic C++ class for my Engineering degree, but I cant stand the ancient Windows machines they have in the computer lab. What are some free compiler options for my PB? I would prefer freeware just because after this semester, I doubt I would ever use C++ again. Any suggestions? :)
 
The Apple developer tools, Xcode, are free.

They should be in the Install folder within your Applications folder.
 
bursty said:
I am forced to take a basic C++ class for my Engineering degree, but I cant stand the ancient Windows machines they have in the computer lab. What are some free compiler options for my PB? I would prefer freeware just because after this semester, I doubt I would ever use C++ again. Any suggestions? :)
Personally I think GCC is the only C++ compiler out there. Funny I know, seriously, I second XCode, its awesome, just learn the environment. I do a lot with it in my spare time.
 
bousozoku said:
The Apple developer tools, Xcode, are free.

They should be in the Install folder within your Applications folder.
And these will compile programs that will transfer over to my professors Windows machine and compile in Visual Studio no problem? If so, thats amazing. They wanted me to drop ~$200 on Visual Studio. :rolleyes:
 
GCC & the XCode toolset fully support the standard C and C++ languages. MSVC still didn't have complete C++ compliance last time I used it, but that was some time ago. In any case, the deviations are small and adapting "proper" C++ code takes a very small amount of time.

There are also versions of GCC for Windows such as MingW32. There aren't any IDEs as nice as XCode, but there are several that are usable. I'm no expert so I don't want to suggest anything.

What you obviously won't be able to do is develop programs that are intended to use Microsoft's specific Windows libraries, which roughly means anything that performs operations you wouldn't expect a text based operating system to perform. There are third party libraries that let you do things like create and manipulate windows in sufficiently generic ways to build on both Mac and Windows, but I suspect they'll be outside of the realm of your course.

So, it really depends what your course is about. If it is more about the normal language without any Microsoft extensions - e.g. data processing, manipulation, advanced calculations, etc - then you won't have any problem. If it starts to head into "we're going to design our window here, then make it work by writing this code..." or "we'll display the output in a simple message box" then you probably won't be able to use a Mac for development - but it is still worth looking into the Windows versions of GCC.
 
bursty said:
And these will compile programs that will transfer over to my professors Windows machine and compile in Visual Studio no problem? If so, thats amazing. They wanted me to drop ~$200 on Visual Studio. :rolleyes:
:eek: :confused: :eek:

If you want full compatibility with VS and don't want to pay for it, just stick with the FREE Microsoft VC++ toolkit, which is the same compiler they use in VS, without the VS IDE and GUI frameworks. http://msdn.microsoft.com/visualc/vctoolkit2003/ Of course that won't run on your PB without VPC. ;)

I too only think of gcc as the one true C/C++ compiler. Thank god it's built in in Xcode.

B
 
bursty said:
And these will compile programs that will transfer over to my professors Windows machine and compile in Visual Studio no problem? If so, thats amazing. They wanted me to drop ~$200 on Visual Studio. :rolleyes:

It depends on what they're trying to do with it.

If you write standard programmes (without any GUI, DOS, or Mac/Windows-dependence), even Visual Studio shouldn't have a problem with all optimisations turned off there.
 
The programs are very simple, such as the one I am working on now:

Write a program that writes to a file, projectile.txt, a table that shows the height of a projectile launched straight up, for each second from launch time (time zero) until the projectile hits the ground. The last entry in the table should show a projectile height of 0. The height after t seconds is given by:

S = Vot -1/2gt^2

Very basic, easily coded in a few minutes but it does use Command Prompt in Windows, which is why I wasnt sure if OSX has a similar Command Prompt (maybe Terminal or something? :confused: ) I guess I will just open up Xcode and see what happens.
 
bursty said:
Very basic, easily coded in a few minutes but it does use Command Prompt in Windows, which is why I wasnt sure if OSX has a similar Command Prompt (maybe Terminal or something? :confused: ) I guess I will just open up Xcode and see what happens.
Yes. Terminal = Command Prompt.

You don't need Xcode for this, just use vi and gcc from within Terminal and become one with your unix side. ;)

B
 
Got everything working and got my program to compile and run unaltered, which I had running on Windows earlier, which is great news! Thanks for the help! :)
 
If you're developing for Windows, you can also download Microsoft's Platform SDK. It has all the compilers, linkers, etc that you need to create Windows programs.

It doesn't include an IDE, though...
 
jalagl said:
If you're developing for Windows, you can also download Microsoft's Platform SDK. It has all the compilers, linkers, etc that you need to create Windows programs.

It doesn't include an IDE, though...

I think the platform SDK still requires a compiler. If you're using visual studio in class, and you've got a windows computer, I'd download Visual C++ express, which is free for a year.
 
bursty said:
Got everything working and got my program to compile and run unaltered, which I had running on Windows earlier, which is great news! Thanks for the help! :)

If you have something that doesn't compile, saying that something can't be found, it's usually that people have tried to use DOS C bindings with header files like conio.h and dos.h. As long as you stay away from that sort of thing, you should be fine.
 
mwpeters8182 said:
I'd download Visual C++ express, which is free for a year.
Thanks for reminding me about that! Note that it's not free for 12 months of usage, but it is free if you download it before November 7, 2006.

http://msdn.microsoft.com/vstudio/express/support/faq/#pricing
12. Do customers who acquire the Visual Studio Express products during the free promotional pricing period have to pay after the first year if they want to continue to use them?

No, as long as you download Visual Studio Express on or before November 7th 2006, you will not have to pay for it.

B
 
balamw said:
Thanks for reminding me about that! Note that it's not free for 12 months of usage, but it is free if you download it before November 7, 2006.

http://msdn.microsoft.com/vstudio/express/support/faq/#pricing


B

Good to know, that's a change from what they originally had planned. A good idea by MS, if you ask me. That's the nice thing about the Mac platform - the developer tools are free. These aren't the full thing, but good for hobbyists/beginners
 
bursty said:
I am forced to take a basic C++ class for my Engineering degree, but I cant stand the ancient Windows machines they have in the computer lab. What are some free compiler options for my PB? I would prefer freeware just because after this semester, I doubt I would ever use C++ again. Any suggestions? :)

As others said, XCode is free. www.metrowerks.com used to have a free download of the CodeWarrior compiler (limited to 32 files, no optimisation), but that seems to be gone.
 
in my opinion Xcode is really hard to use, unless you really know what your doing, and most of the features it has your never going to use, or even understand what there for. An easier IDE to learn and use is Netbeans. Thats what I use, its free to download. Another mac IDE is eclipse.
 
In my opinion any piece of software is hard to use if you don't know what you are doing, and netbeans and eclipse have much more features than XCode.
 
xcode compiler

I posted in the iphone programming section thinking that it was the right place. However, this thread seems more applicable.

Since the wiki said to learn C first, I bought the C programmign guide and wanted to do the exercises in xcode while writing C.

Is there a guide out there describing how to compile programs in xcode written in C?

thanks..
 
Xcode!!!

Xcode all the way! It's on your mac disk or on hard disk. If you don't have it then download it online for free. You just need to make a special Apple Developer Community ID. WONDERFUL PROGRAM!!!!
 
The Apple developer tools, Xcode, are free.

They should be in the Install folder within your Applications folder.

um these are not free you have to sign up and pay to use them... can some one explain what im doing wrong????
 
can some one explain what im doing wrong????

Yes I can, you are responding to a 5 year old thread. The latest version of Xcode is $4.99 on the Appstore, I don't think you have to sign up to get it from there. But, you have Xcode on your OS X install disk.
 
Yes I can, you are responding to a 5 year old thread.

ROFL ;) Any thread where PPC was still the norm should probably not get added to.

The latest version of Xcode is $4.99 on the Appstore, I don't think you have to sign up to get it from there. But, you have Xcode on your OS X install disk.

Correct:

Xcode 4 is $4.99 from the Mac App Store.

Xcode 3 is usually available on your OS X install disc, and is also available from Apple Developer Connection as a free download.

Down in the bottom right of the page here: http://developer.apple.com/xcode/ you will find a link that says "Looking for Xcode 3". Click that and register for a free ADC account using the "join now" link on that page.

B
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.