Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Objective-C help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Raz0rEdge" data-source="post: 1241723" data-attributes="member: 110816"><p>This is strange now, I'm trying this on my Mac at home and am getting the exact same problem as Bikka..this works in the Linux environment, but not so in Mac. I've got the same version of GCC as you two..4.2.1.</p><p></p><p>The preprocessing of Greeter.m shows that the "Object.h" file is being pulled from /usr/include/objc..</p><p></p><p>This has piqued my curiosity..gonna investigate this further..</p><p></p><p><strong>Update</strong>: OK, I got it to work</p><p>[CODE]</p><p>$ gcc -o Greeter Greeter.m -lobjc -m32</p><p>$ file Greeter</p><p>Greeter: Mach-O executable i386</p><p>$ ./Greeter </p><p>Hello, World!</p><p>[/CODE]</p><p></p><p>Without the "-m32" flag we get</p><p>[CODE]</p><p>$ file Greeter</p><p>Greeter: Mach-O 64-bit executable x86_64</p><p>[/CODE]</p><p></p><p>So my guess is that we don't have the multi-lib support and were trying to build the 64-bit application against the 32-bit libraries, with the "-m32" they match and things work..</p></blockquote><p></p>
[QUOTE="Raz0rEdge, post: 1241723, member: 110816"] This is strange now, I'm trying this on my Mac at home and am getting the exact same problem as Bikka..this works in the Linux environment, but not so in Mac. I've got the same version of GCC as you two..4.2.1. The preprocessing of Greeter.m shows that the "Object.h" file is being pulled from /usr/include/objc.. This has piqued my curiosity..gonna investigate this further.. [B]Update[/B]: OK, I got it to work [CODE] $ gcc -o Greeter Greeter.m -lobjc -m32 $ file Greeter Greeter: Mach-O executable i386 $ ./Greeter Hello, World! [/CODE] Without the "-m32" flag we get [CODE] $ file Greeter Greeter: Mach-O 64-bit executable x86_64 [/CODE] So my guess is that we don't have the multi-lib support and were trying to build the 64-bit application against the 32-bit libraries, with the "-m32" they match and things work.. [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Objective-C help
Top