Thread: C++ OS X question

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    6

    C++ OS X question

    Hello

    I'm using code blocks and I have a bit of a question. Once I have compiled my code I can run it in the console from the IDE. My question is this--Is there any way to create something that is equivalent to the .EXE file that code blocks automatically creates when using Windows? For example, If I wrote a program and wanted to burn it so my buddy can run it on his computer, how would I do that?

    Sorry if the answer is terribly simple...I'm still quite new to programming, and particularly programming in OS X.

    Thank you!

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Are you on OS X, is he on OS X, both, or neither? If you're both on the same platform, then the exectuable created should be runnable on his machine just the same.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    6
    oh sorry, suppose i should have clarified a bit!

    What about running a program created in os x on a windows machine? I know how to run on os x just not from os x to windows. Any help is greatly appreciated!

  4. #4
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    That is a little more difficult (i.e., without an emulator of some sort, it will not work) because the executable file format is completely different.

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    gcc can be set up as a cross-compiler (compiling for a different machine than it's running on), but it doesn't come that way "out of the box" -- you'd have to do some fancy footwork to make it happen.

  6. #6
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937
    You could give him the code and have him compile it on his Windows compiler.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  7. #7
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,534
    tabstop is certainly right about cross-compiling, though CodeMonkey's idea is most likely the easiest. Have a look at this for a possible cross-compiling solution.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mac OS X aliases
    By rak1986 in forum C Programming
    Replies: 4
    Last Post: 01-21-2009, 12:11 PM
  2. Mac OS question
    By Stonehambey in forum C++ Programming
    Replies: 9
    Last Post: 03-29-2008, 04:06 AM
  3. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM
  4. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM
  5. question from linux board ( not os dependant )
    By crypto in forum C Programming
    Replies: 4
    Last Post: 11-15-2002, 02:09 AM