PDA

View Full Version : Best Free C++ Compiler?




bursty
Feb 13, 2006, 04:22 PM
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? :)



bousozoku
Feb 13, 2006, 04:31 PM
The Apple developer tools, Xcode, are free.

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

slooksterPSV
Feb 13, 2006, 04:40 PM
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.

bursty
Feb 13, 2006, 04:41 PM
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:

Thomas Harte
Feb 13, 2006, 04:57 PM
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 (http://www.mingw.org/). 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.

balamw
Feb 13, 2006, 05:05 PM
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

bousozoku
Feb 13, 2006, 05:35 PM
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.

bursty
Feb 13, 2006, 06:23 PM
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.

balamw
Feb 13, 2006, 06:26 PM
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

Melkor
Feb 13, 2006, 06:56 PM
http://forums.macrumors.com/showthread.php?t=179487

i took that guys advice in my thread and it worked out great.

use terminal and textwrangler, works a charm ;)

bursty
Feb 13, 2006, 07:06 PM
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! :)

jalagl
Feb 14, 2006, 06:02 AM
If you're developing for Windows, you can also download Microsoft's Platform SDK (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdkintro/sdkintro/devdoc_platform_software_development_kit_start_page.asp). It has all the compilers, linkers, etc that you need to create Windows programs.

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

mwpeters8182
Feb 14, 2006, 10:16 AM
If you're developing for Windows, you can also download Microsoft's Platform SDK (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdkintro/sdkintro/devdoc_platform_software_development_kit_start_page.asp). 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.

bousozoku
Feb 14, 2006, 01:58 PM
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.

balamw
Feb 14, 2006, 02:19 PM
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

mwpeters8182
Feb 14, 2006, 08:24 PM
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

gnasher729
Feb 15, 2006, 12:48 AM
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.

bigmat1201
Oct 31, 2008, 12:48 AM
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 (http://www.netbeans.org/downloads/start.html?platform=macosx&lang=en&option=cpp). Thats what I use, its free to download. Another mac IDE is eclipse.

MacRumors Guy
Oct 31, 2008, 11:53 AM
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.

FreeLunch1
Oct 31, 2008, 12:01 PM
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..

lee1210
Oct 31, 2008, 12:41 PM
This thread is 32 months old. Start a new one if there's a new question.

-Lee

appledyl
Sep 23, 2009, 03:44 PM
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!!!!

sover435
Jun 13, 2011, 03:30 PM
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????

subsonix
Jun 13, 2011, 03:48 PM
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.

balamw
Jun 13, 2011, 07:51 PM
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

gumoz
Jun 13, 2011, 09:23 PM
The Tools are Still Free, for what you pay $4.99 is if you want to download Xcode without having a registered account.

A registered account is still free, your Mac Installation Disk also contains an Xcode version.

jared_kipe
Jun 14, 2011, 04:35 PM
Hey, I'd pay $5 to have constant update (at least reminders) and especially delta updates. Every time I see a new iOS/Xcode update come down the tubes I know I'm going to be downloading a few solid gigabytes.

mobilehaathi
Jun 15, 2011, 06:56 PM
gcc (http://gcc.gnu.org/)

Although the OP has probably graduated by now.

subsonix
Jun 15, 2011, 07:19 PM
gcc (http://gcc.gnu.org/)

Although the OP has probably graduated by now.

Only problem with that is that there is no OS X binary available on that site. You would thus need to compile it from source, which means you must have a compiler available. I think Fink has GCC binaries available.

balamw
Jun 15, 2011, 07:57 PM
Only problem with that is that there is no OS X binary available on that site. You would thus need to compile it from source, which means you must have a compiler available. I think Fink has GCC binaries available.

HPC definitely does. http://hpc.sourceforge.net/

Fink and MacPorts are strange in that they need a compiler for most everything...

B

subsonix
Jun 15, 2011, 08:19 PM
HPC definitely does. http://hpc.sourceforge.net/

Fink and MacPorts are strange in that they need a compiler for most everything...

B

Fink does provide quite a few binaries it appears, I never used Fink myself but I think this is in part what differs from MacPorts. GCC binaries is available it appears but then you will first have to install Fink of course. Your link might be a better option.

http://pdb.finkproject.org/pdb/browse.php?summary=compiler+binaries+gcc