Sidharth
SOLUTION: How to compile Objective C on Windows with GNU Step ?
0 Answer(s)      4 years and 5 months ago
Posted in : Development process
<p>I just started learning ObjC today and found this tutorial informative, except the fact that the above program needs some more instructions to run. Here is what I did to make it run></p>

<p><strong>User path after installing GNU Step:</strong>
F:\GNUstep\home\Sid</p>

<p>Following are code files in the above mentioned User path:
MyClass.h
MyClass.m
main.m</p>

<p><strong>Header files of GNU step are placed here(after installation):</strong>
F:\GNUstep\GNUstep\System\Library\Headers\Foundation</p>

<p><strong>Import statement in MyClass.h file modified as:</strong></p>

<h1>import<../../GNUstep/System/Library/Headers/Foundation/Foundation.h></h1>

<p><strong>Compile using the below mentioned command line:</strong></p>

<p>gcc -o myclass main.m -I/f/GNUstep/GNUstep/System/Library/Headers \
-L /f/GNUstep/GNUstep/System/Library/Libraries -lobjc -lgnustep-base \
-fconstant-string-class=NSConstantString</p>

<p>(Note that "\" character allows us to extend command to multiple lines.)</p>

<p><strong>Binary created is:</strong>
myclass.exe</p>

<p>The output I received:
Sum is:11 &lt; Current date and time is displayed after this, not sure why!></p>

<p>Regards,
Sidharth</p>    
Advertisement
View Answers









Related Tutorials/Questions & Answers: