-
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!
-
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.
-
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!
-
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.
-
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.
-
You could give him the code and have him compile it on his Windows compiler.
-
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.