I have started learning C++ recently and i'm wondering how I can turn my .cpp file with my code into a .app file that I can give to someone to run on their mac? I mean if I took a .cpp file I could do "g++ -o main main.cpp" and "./main" but I want a .app file that I just double click and it runs the program
Asked
Active
Viewed 743 times
0
-
rename the file? A .cpp file is just a text file so treat it like one. – NathanOliver Jan 21 '18 at 01:22
-
I already tried that and it doesnt open. – Thomas Voss Jan 21 '18 at 01:26
-
1Well, `.cpp` is source code, `.app` is an executable application bundle. You'll have to compile your source code into a functional application. Xcode is Apple's tool of choice to do that. See also [this question](https://stackoverflow.com/questions/11365612/building-an-app-bundle-for-a-non-cocoa-c-mac-project). – rickdenhaan Jan 21 '18 at 01:27
-
how do I actually compile it though? @rickdenhaan – Thomas Voss Jan 21 '18 at 01:44
-
I haven't worked with Xcode in a few years, but IIRC it used to have an Archive feature that allowed you to build the application and export a .app file. Not sure if that's still the case today or if they've moved the build and export features somewhere else. – rickdenhaan Jan 21 '18 at 19:54