Mac Program

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2006
Posts: 37
Reputation: Firestone is an unknown quantity at this point 
Solved Threads: 0
Firestone Firestone is offline Offline
Light Poster

Mac Program

 
0
  #1
Jul 22nd, 2007
I'm using Dev C++, and I want to compile my program into a program usable on macs. Can I do this from Dev C++, or do I have to use a different program?
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 170
Reputation: TkTkorrovi is on a distinguished road 
Solved Threads: 11
TkTkorrovi's Avatar
TkTkorrovi TkTkorrovi is offline Offline
Junior Poster

Re: Mac Program

 
0
  #2
Jul 22nd, 2007
Yes you can do that and source code is portable as well, gcc is Mac main compiler. And use GTK there is also GTK for Mac. Of course it would not work on Mac, when you use Windows API. Once dev-c++ had a package system, which enabled to easily install GTK, but i didn't use it now for so long time. Installing GTK in Windows is unfortunately a bit tricky, as it involves extracting several libraries into the same directory tree.
Knowledge is regarded by the fool as ignorance, and the things that are profitable are to him hurtful. He liveth in death. -- Thoth the Atlantean
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 37
Reputation: Firestone is an unknown quantity at this point 
Solved Threads: 0
Firestone Firestone is offline Offline
Light Poster

Re: Mac Program

 
0
  #3
Jul 22nd, 2007
Well, right now its just a text console program I want to give to my friend. Can you please tell me how to do this from Dev C++? Any help would be great, thanks!
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 170
Reputation: TkTkorrovi is on a distinguished road 
Solved Threads: 11
TkTkorrovi's Avatar
TkTkorrovi TkTkorrovi is offline Offline
Junior Poster

Re: Mac Program

 
0
  #4
Jul 22nd, 2007
It is certainly possible, but likely not that simple. Read the gcc manual http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc You may try add to compiler options -b powerpc and -mcpu=powerpc, but most likely this would not be enough. Using gcc as a cross-compiler may iinvolve installing some additional files, and compiling gcc for being a cross-compiler for the target platform. Using cross-compiler is anyway not that simple, that you compile a binary and give it to a friend, you should most likely test it, in windows there is a powerpc emulator for that. So a realistic option, unless you have to do some serious cross-compiling, is still to compile it for your computer, and give the source code to a friend (a source distribution), maybe add the makefile, gcc is installed in every os x, and it is not difficult for your friend to compile your program.
Knowledge is regarded by the fool as ignorance, and the things that are profitable are to him hurtful. He liveth in death. -- Thoth the Atlantean
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: Mac Program

 
0
  #5
Jul 28th, 2007
Looks like I came to this thread a bit late, but I thought I'd throw in my 2 cents-worth.

First of all - don't even think about compiling anything until you've installed the Apple Developer Tools. There's a disc that comes with Mac OS X that contains this bundle of tools, but you can also download a more current version of it for free from Apple's website. Basically the set of tools contains Xcode, the primary IDE for software development on Macs, as well as command line utilities like gcc.

Once you have it installed, you have two options: use the command line, or use Xcode to build everything. I find Xcode faster to use for larger projects, so if you've got a number of source files, just add them into the Xcode project window and hit "Build and Run". Hopefully everything is self-explanatory. If you decide to use the command line, you'll want to use a makefile as has already been mentioned. Good luck!

[edit] It also depends on the Mac's architecture. Intels should have practically no problems running standard C++ code written in Windows, whereas you might have some endian-ness issues with the older PowerPC-based Macs.
Last edited by John A; Jul 28th, 2007 at 4:24 am.
"Technological progress is like an axe in the hands of a pathological criminal."

All my posts may be freely redistributed under the terms of the MIT license.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC