[Tutorial] Getting started on Mac OS X

A forum to store posts deemed exceptionally wise and useful

[Tutorial] Getting started on Mac OS X

Postby osxus3r » Mon Jun 26, 2006 11:36 pm

I figured my problem in my prev. post so I thought I should share the solution. then I thought its easier to explain eveything from the beginning. So here we go.

Getting started on Xcode

You will need Xcode 2 which can only be installed on Mac OS 10.4 (aka Tiger).

1. Create empty project: File->New Project and select Empty Project at the top. Then click next. Give it any name you want and Click Finish

2. Now add some Frameworks. On the left hand side you should see a column with your project name at the top (blue icon). Select it, then right click and choose Add->Existing Framworks. You will need to add 4 Framworks, AppKit, Carbon, Cocoa and of course OpenGL. They should reside in /System/Library/Framworks. Select them and click Add. Then click Add Again.


3. Now add the libMacOSX.a file. The same way you added the frameworks, Add->Exsisting Files. Make sure you have selected "Recursively create groups for any added folders". And check "Copy items into destination group's folder (if needed)"

4. Adjust the project, go to Project -> Edit project settings, go to build tab and set SDK path to wherever you have MacOSX10.4u.sdk, i.e.
/Developer/SDKs/MacOSX10.4u.sdk. Then set Header Search Paths to
/irrlicht-1.0/include or wherever you have include folder from Irrlicht.

5. Add a new target. Project -> New Target. Select Carbon/Application (not Cocoa!). Give it a name. Click triangles under Targets till you see Link Binary with Libraries. Select all the frameworks you've added and also libMacOSX.a and drag it underneath.

6. Now right click on your project icon add choose Add->New Files. Then select BSD/C++ File. Uncheck 'Also create " .h" ' as we dont need it at this stage. Name main.cpp or something and click Finish. Copy and paste code from 1st Tutorial, but also add #include <OpenGL/OpenGL.h> at the top. And change quotes in #pragma comment.. to double quotes, i.e #pragma comment(lib, "libMacOSX.a").

7. Make sure you have "Release" selected as active build configuration. Now go to Build->Build and Run.
osxus3r
 
Posts: 2
Joined: Sun Jun 25, 2006 11:03 pm

Postby hybrid » Mon Jun 26, 2006 11:39 pm

This post should obviously go to the FAQ forum, I guess some admin will move it.
Does anyone know if the XCode requirement is mandatory, i.e. is there some vital API which is used, or is it mainly due to coding style or simple the XCode project?
hybrid
Admin
 
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Postby osxus3r » Tue Jun 27, 2006 12:40 am

hybrid wrote:..
Does anyone know if the XCode requirement is mandatory, i.e. is there some vital API which is used, or is it mainly due to coding style or simple the XCode project?


no its not mandatory, all Xcode does is invokes gcc with a bunch of parameters and g++ does the rest. But you need to include those Frameworks/APIs and you need to somehow create a .app (application) file. Are you thinking about cross-compiling it outside of Mac OS?
osxus3r
 
Posts: 2
Joined: Sun Jun 25, 2006 11:03 pm

Postby zathras » Sat Sep 23, 2006 5:42 pm

Hi all,

I went through this tutorial -- thanks for posting it. I rewrote it in an idiot-proof ;-) way and added some screenshots.

Irrlicht + XCode idiot-proof beginner's tutorial

If you have comments, updates or corrections, just tell me!

zathras
zathras
 
Posts: 4
Joined: Sat Sep 23, 2006 5:34 pm

Postby dogbrain » Mon Sep 25, 2006 4:52 pm

Anyone got 1.1 to compile properly. Would be really happy if someone could upload a working binary of the lib or explain how to do it with 1.1. The examples included in the project doesnt work for me.

I have almost given up... thinking of looking after a new 3d engine... :(
A computer program will always do what you tell it to do, but rarely what you want to do.
User avatar
dogbrain
 
Posts: 6
Joined: Tue Sep 19, 2006 9:42 am

Postby hybrid » Mon Sep 25, 2006 6:36 pm

1.1 did not work properly. Use Irrlicht SVN which should work (not the most recent versions, but try around 230 - newer versions require some more files to be added to the XCode project).
hybrid
Admin
 
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Postby itistoday » Thu Sep 28, 2006 6:52 am

dogbrain wrote:Anyone got 1.1 to compile properly. Would be really happy if someone could upload a working binary of the lib or explain how to do it with 1.1. The examples included in the project doesnt work for me.

I have almost given up... thinking of looking after a new 3d engine... :(

Hi, I just got it working: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=15920
itistoday
 
Posts: 2
Joined: Thu Sep 28, 2006 4:12 am

libMacOSX.a

Postby kittycar275 » Thu Nov 16, 2006 2:20 am

Hey, I dont have a libMacOSX.a file in my folder, could some one please tell me how can I build it myself? Thanks
kittycar275
 
Posts: 1
Joined: Thu Nov 16, 2006 2:17 am

Postby garrittg » Thu Dec 28, 2006 2:49 pm

here is a link to a compiled OSX version for Irrlicht v1.2. i will try to keep this updated for future versions since im already providing a precompiled GCC+DX version. Jonas compiles this for me for use with the BlitzMax mod. (again a big thank you to Jonas!).

http://www.gprogs.com/irrlicht.mod/libIrrlichtMac_v1_2.zip
garrittg
 
Posts: 117
Joined: Wed Apr 20, 2005 6:17 pm
Location: Iowa, USA

Postby jasonroyle » Sun Feb 25, 2007 8:58 am

could someone please post a link to the libMacOSX.a for version 1 of irrlicht because I'm trying to run through this tutorial with the v1.2 lib and v1.2 irrlicht but it doesn't seem to be working. It builds it and then it runs it but it just comes up with a blank window ¬.¬ I'm probably doing something really stupid 'cos I'm completly new to irrlicht and even C++ but I'd like to get it working...

I'm trying to get the Hello Word example to work (that comes with irrlicht1.2) (irrlicht-1.2/examples/01.HelloWorld/) and I just copy the code in the main.cpp within that folder and do what it says in this tutorial...
jasonroyle
 
Posts: 1
Joined: Sun Feb 25, 2007 8:46 am

Postby garrittg » Thu Apr 12, 2007 1:03 am

here is a link to a compiled OSX version for Irrlicht v1.3. (a big thank you to Jonas!).

http://www.gprogs.com/irrlicht.mod/libIrrlichtMac_v1_3.zip
garrittg
 
Posts: 117
Joined: Wed Apr 20, 2005 6:17 pm
Location: Iowa, USA

Postby andyvn22 » Sat Apr 14, 2007 3:25 am

Using the precompiled libIrrlichtMac.a to make a test app, I get "Undefined symbols: ___dso_handle" Any ideas?

I'd compile it myself, but when I tried that, I got "(jcapimin.o) has local relocation entries in non-writable section (__TEXT,__text)" After a bit of googling, I turned off -mdynamic-no-pic when compiling the library. This fixed that problem, but then I got about a billion irrlicht-related undefined symbols when compiling my test app.

Also at some point while using -both- of these methods I ended up with a "table of contents for archive: libIrrlicthMac.a is out of date" error and had to run ranlib to get it to go away.

I'm really out of my element with all of this stuff, I'd like to get things working so I can deal with code-related errors! I'm amazed at the number of different problems that can be encountered when just downloading and trying to use a library.

Oh, furthermore (or possibly this is the cause of these issues), a ton of the files in the Xcode project were missing, most of which had either been renamed or moved; I had to find all of those. A few I deleted because no equivalent appeared to exist, but I think it was OK, since as far as I can tell, no reference to these files or their subjects was made anywhere else in the project: CZBuffer2.cpp, ITriangleRenderer2.h, and IZBuffer2.h.

Also, does anyone have an explanation for how such huge numbers of problems occur? It's not specific to Irrlicht, I tried Ogre when all this happened, and that had similar issues... how can there be so many problems and people still get it working? And why aren't there more solutions to these problems? Do they only happen to me? I don't understand how I can encounter all these issues when everyone else seems to have it running fine. I've followed several different step-by-step tutorials, and NONE of them have worked.
andyvn22
 
Posts: 2
Joined: Sat Apr 14, 2007 3:06 am
Location: Red Hook, NY

Postby phlogios » Fri Aug 03, 2007 9:27 pm

When I compile the tutorial 1 program, all I get is a blank window with the correct title. The console (in xcode) says that it cant load the mesh called sydney.md2. What did I do wrong? I'm guessing that I have to change some directory of something. The model is in /Users/gustavpihl/Desktop/irrlicht-1.0/media
hAlp!?
phlogios
 
Posts: 13
Joined: Fri Aug 03, 2007 9:23 pm
Location: Lund, Sweden

Postby phlogios » Fri Aug 03, 2007 9:52 pm

I managed to load the mesh and the texture (according to Run Log) but the window is still blank. No error message.

[Session started at 2007-08-03 23:50:53 +0200.]
Irrlicht Engine version 1.0
Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386
Loaded texture: #DefaultFont
Loaded mesh: ../../media/sydney.md2
Loaded texture: ../../media/sydney.bmp
hAlp!?
phlogios
 
Posts: 13
Joined: Fri Aug 03, 2007 9:23 pm
Location: Lund, Sweden

Postby ssexton » Fri Aug 03, 2007 9:54 pm

phlogios wrote:When I compile the tutorial 1 program, all I get is a blank window with the correct title. The console (in xcode) says that it cant load the mesh called sydney.md2. What did I do wrong? I'm guessing that I have to change some directory of something. The model is in /Users/gustavpihl/Desktop/irrlicht-1.0/media


Hm. I remember getting the blank window when I first started out, but I don't remember any errors loading the models. Two possibilities for the blank window:

1. Make sure the MainMenu.cpp code looks like this (I didn't check SVN), as the Burning's driver isn't available on Mac OS X:

#ifdef MACOSX
device = createDevice(video::EDT_OPENGL,
core::dimension2d<s32>(512, 384), 16, false, false, false, this);
#else
device = createDevice( video::EDT_BURNINGSVIDEO,
core::dimension2d<s32>(512, 384), 16, false, false, false, this);
#endif

2. Make sure you are running it from the app bundle (double-click in Finder) not from the terminal. I don't think it'll work from terminal.

After that, in the main menu screen (assuming you can see it) when you start the demo, be sure you select OpenGL driver. Again, because that is the only one Mac OS X has.

Also, I see you have 1.0 in your path. Don't use the 1.0 SDK on the website (aside: someone should really take it down). It is old, old, old and broke, broke, broke. Build (or download from off-site, I saw some links in this thread) something newer, 1.2 or better will work much better for you.
ssexton
 
Posts: 54
Joined: Wed Oct 25, 2006 7:46 am
Location: South Florida

Next

Return to FAQs, Tutorials, Howtos, and external tool lists

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest