| | |
Mac Program
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2006
Posts: 37
Reputation:
Solved Threads: 0
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
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
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.
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
•
•
Join Date: Nov 2006
Posts: 37
Reputation:
Solved Threads: 0
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
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
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
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.
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.
All my posts may be freely redistributed under the terms of the MIT license.
![]() |
Similar Threads
- Windows XP / Mac OS X conflict (Mac Software)
- JVM GetLastErrorString Crash - OS X 10.4.7 (Java)
- remainder program in C++ (C++)
- Is it possible to execute programs without “.exe� file extension? (Windows Software)
- i can't delete files (OS X)
Other Threads in the C Forum
- Previous Thread: help with pseudocode
- Next Thread: how to complile and execute a c pro in editplus
| Thread Tools | Search this Thread |
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic fflush file floatingpointvalidation fork frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string strings structures suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h






