compiler question

Joined
Mar 17, 2010
Messages
3
Reaction score
0
Points
1
Hello,

I recently started working with XCode. I was curious why programs compiled under xcode do not run when used in a unix environment. For example, when I wrote the Hello World program in Xcode and moved it to my linux machine it would not run. I had to gcc main.c before it would run. I thought the underlying architecture for OS X was unix so I expected ./HelloWorld to run.

Thank you for your help!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Unix does not equal Linux. Mac OS X is Unix, Linux is Unix-like. You'll find that despite similiarities, you'll have to recompile programs. Someone with more experience in deploying across OSes can be more clear on that one.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Is your linux machine a PC? If yes that's your main problem right there.
Even if not, like Van said not all *nixes are equal. Also some libraries are machine specific and need to be recompiled for that machine.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top