Hi folks.
I'm trying to compile RakNet for the mac. The readme portion pertaining to macs is the following:
If you try to compile this, it gives you errors when you get to the "gcc -c -I ../Include -isysroot /Developer/SDKs/MacOSX10.4u.sdk/ -arch i386 *.cpp" part. I am wondering if this refers to the part I highlighted in red about compiling it within Xcode.
Is there a way to compile GCC command lines from within Xcode? If so, please let me know where I put the arguments in xcode. Or is there some special terminal command I need to enter so that the terminal command runs it through Xcode somehow?
If anyone has any pointers, I'd really appreciate it.
I'm trying to compile RakNet for the mac. The readme portion pertaining to macs is the following:
-----------------------------------------
Mac Users
-----------------------------------------
From My Community - Index
Open a Terminal window and type: cd ~/Desktop/RakNet/Source
Give the following command:
Code:
g++ -c -DNDEBUG -I -isysroot /Developer/SDKs/MacOSX10.5u.sdk/ -arch i386 *.cpp
Use whichver SDK you have. However, the 10.4 SDK is bugged and will not compile unless you use GCC 4.0 from inside XCODE
The sources should build cleanly. This gives you a bunch of PowerPC binaries, compiled against the 10.3.9 SDK which is a good thing.
Give the following command:
Code:
libtool -static -o raknetppc.a *.o
This will stitch together a static library for the PowerPC architecture. There may be warnings that some .o files do not have any symbols. If you want to be prudent, remove the named files (the .o files, not the .cpp files!) and re-run the libtool command.
Now, we build the source files for Intel:
Code:
gcc -c -I ../Include -isysroot /Developer/SDKs/MacOSX10.4u.sdk/ -arch i386 *.cpp
..and stitch it into a i386 library:
Code:
libtool -static -o rakneti386.a *.o
Now, type:
Code:
ls *.a
which should list the two .a files. Now, we make them into a universal binary:
Code:
lipo -create *.a -o libraknet.a
You now have a file named libraknet.a. This is the RakNet library, built to run on both PowerPC and Intel Macs. Enjoy! ;-)
If you try to compile this, it gives you errors when you get to the "gcc -c -I ../Include -isysroot /Developer/SDKs/MacOSX10.4u.sdk/ -arch i386 *.cpp" part. I am wondering if this refers to the part I highlighted in red about compiling it within Xcode.
Is there a way to compile GCC command lines from within Xcode? If so, please let me know where I put the arguments in xcode. Or is there some special terminal command I need to enter so that the terminal command runs it through Xcode somehow?
If anyone has any pointers, I'd really appreciate it.