[Tutorial] Getting started on Mac OS X

A forum to store posts deemed exceptionally wise and useful
Smoo
Posts: 4
Joined: Fri Aug 08, 2008 1:22 pm

Post by Smoo »

I grabbed 1.4.1 but I don't think I saw any binaries in there, so I compiled according to Zathras' tutorial without any problems. Where can I get the binaries?

I'm using the latest XCode. I didn't see Varmint in there, but I'll check again later.

Also, is there a tutorial which is accurate to the latest versions of everything? I mean, the two tutorials here (and the first one in the package I downloaded) are either outdated, incorrect, or else I'm making a really silly and obvious mistake.

Thanks again!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well zathras tutorial is two years old... You should be able to just use the XCode project provided, should create the library and the examples. Just click the 'make everything nice' button...
Smoo
Posts: 4
Joined: Fri Aug 08, 2008 1:22 pm

Post by Smoo »

Thanks for your efforts, hybrid.

Anyway, I...

1: download the 1.4.1 package
2: open up the XCode project
3: XCode asks me the folder to use as the project root, so I select source/Irrlicht/MacOSX and click Open
4: I click "Build"
5: Wait while everything compiles

Then when I try and run any of the examples, I get "no executable present at path". What am I doing wrong? Am I building from the wrong location or something and not ending up with an executable?

My goal is to be able to compile and run these examples so that I have a working foundation I can use to gain an understanding of the library and eventually create my own projects. I'll be very pleased when I can get one to run! :)


EDIT: Crap! I had to change my active target in the toolbar atop the project window. That's what I get for being a newbie! I mean, I've used XCode for single-files but not for entire projects. Time to familiarize myself for a while, but at least I have Irrlicht set up to tinker with. Thanks again :)
jayands
Posts: 1
Joined: Sat Sep 06, 2008 3:12 am
Location: Las Vegas, NV

Post by jayands »

hello,

On my MacBook intel with XCode 3 and 10.5 Leopard, I get the following errors repeated two times in the same file (`CIrrDeviceMacOSX.mm'):

Code: Select all

error: invalid conversion from 'long int*' to 'GLint*'
error:  initializing argument 3 of 'CGLError CGLChoosePixelFormat(const CGLPixelFormatAttribute*, _CGLPixelFormatObject**, GLint*)'
error: invalid conversion from 'long int*' to 'GLint*'
error:  initializing argument 3 of 'CGLError CGLSetParameter(_CGLContextObject*, CGLContextParameter, const GLint*)'
I also get the warning that 'cString' is deprecated.

I am trying to build it as the Release version, for OSX 10.5, because if I try to build it for 10.4 Release, it doesn't seem to want to work with my program (100+ errors, mostly about .NET functions). Any ideas?

EDIT: The make target is 'libirrlicht.a' as 'Release' for '10.5', just to clarify.
wolfpack
Posts: 4
Joined: Sat Feb 10, 2007 10:11 am

Post by wolfpack »

jayands wrote:hello,

On my MacBook intel with XCode 3 and 10.5 Leopard, I get the following errors repeated two times in the same file (`CIrrDeviceMacOSX.mm'):

Code: Select all

error: invalid conversion from 'long int*' to 'GLint*'
error:  initializing argument 3 of 'CGLError CGLChoosePixelFormat(const CGLPixelFormatAttribute*, _CGLPixelFormatObject**, GLint*)'
error: invalid conversion from 'long int*' to 'GLint*'
error:  initializing argument 3 of 'CGLError CGLSetParameter(_CGLContextObject*, CGLContextParameter, const GLint*)'
I also get the warning that 'cString' is deprecated.

I am trying to build it as the Release version, for OSX 10.5, because if I try to build it for 10.4 Release, it doesn't seem to want to work with my program (100+ errors, mostly about .NET functions). Any ideas?

EDIT: The make target is 'libirrlicht.a' as 'Release' for '10.5', just to clarify.
I changed CIrrDeviceMacOSX.mm, line 128, to:

Code: Select all

	GLint			numPixelFormats,newSwapInterval;
You could also cast the pointers explicitly, but this is cleaner. Someone should probably make this change to the svn too.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Thanks for this, will be fixed in SVN soon.
Teemo
Posts: 5
Joined: Wed Nov 12, 2008 12:24 pm

Post by Teemo »

Hey Guys,

I need some help :-/


I'm new to C++ and Xcode developing. I'm having a problem to set up my xcode.

I read through the forum and googled a lot but i couldnt fix my problem.


I downloaded irrlicht-1.4.2 for mac and started to xcode-project to compile.

Everything worked well and i got my libIrrlicht.a created.

Then I created a new Project, added the frameworks to my xcode (3.0) project and i used "project -> add to project -> libIrrlicht.a".

I also added the "Header Search Path"

But when i try to compile and run the 01 Hello World example i get 36 errors :-/


like this :

Code: Select all


<include irrlicht.h>
"error: irrlicht.h: No such file or directory"

So probably there is something wrong with my path but i have no clue what else to do.


So i this guide in this thread is pretty old and i read there is official mac support now.

Is there an easier way to set up an xcode project ?


Guys, please help me out and dont blame me if i'm too noobish :)

I would really appreciate it


Greetz

Teemo
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

Your additional search paths are not looking in the right place is all.
They need to point to the include folder , not a root or one above it.
Plus, there is "USer search paths" "additional search paths" and the other one i forget... but its best to put it in "user" and then check the little box that says "Always search user paths".

Then, make sure that the libIrrlicht.a is added to the additional lib search paths, where you specify the folder its in as well.
Teemo
Posts: 5
Joined: Wed Nov 12, 2008 12:24 pm

Post by Teemo »

hm... I added to

Libary Search Path : /Users/timo/Downloads/irrlicht-1.4.2/source/Irrlicht/MacOSX/build/Release/



and to
User Header Search Path :

/Users/timo/Downloads/irrlicht-1.4.2/include


But still not working ....

My xcodeproject looks like this :

http://img233.imageshack.us/my.php?imag ... ectez3.jpg
Last edited by Teemo on Wed Nov 12, 2008 7:07 pm, edited 1 time in total.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

/Users/timo/

/Users/timokolthof/
?
Teemo
Posts: 5
Joined: Wed Nov 12, 2008 12:24 pm

Post by Teemo »

ahhh u got me :)


I corrected the name course i just wanted to post my full name here.


Nevertheless it's not working even with the right path with my fullname set.
CheekyyMonk3y
Posts: 2
Joined: Mon Mar 30, 2009 1:50 am

Post by CheekyyMonk3y »

I'm having the same issue as timo. I'm using xcode 3, irrlicht 1.4.2, and obviously 10.5. I added all the files, and everything compiles fine. But the only issue is that no window pops up, and it says the project exits with status 5. I've followed both this: http://ruthless.zathras.de/facts/apps/p ... on-mac.php , and the hello world tutorial to try to get this working, but both end up with the same result. Any help would be appreciated.

Thanks
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Try Irrlicht 1.5 with the XCode project. It should just work, it does for me anyway
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Indeed the xcode project compiles right out of the box. I get the "libIrrlicht.a" created properly (should it be renamed to something else?), and I copy it into the /lib/MacOSX folder to then try to compile the examples; however, when I compile an example it says it was compiled fine (no errors) but I can't find an executable (.app?) to run it.

anyone knows where the compiled examples are placed?

regards,
Alvaro
Image
Fareusel
Posts: 5
Joined: Mon Apr 20, 2009 12:48 pm

Post by Fareusel »

in your project folder is a subfolder called "Release". You find the .app there. The name of the irrlicht-library doesn't matter while it is correctly included in your project.

--

I've problems with setting up a working Irrlicht app:

As described in Ruth's tutorial, i've set up every thing (libIrrlicht.a, projectsettings for include pathes and frameworks...). I'm working with Mac OS X 10.5.6 and Xcode 3.1.2.

Now I tried to make the 1st tutorial (Hello World), but all I get is a white mesh. I use the sample files, so there shouldn't be any problem with texture coordinates. If I include the GUIenviroment, I get these white pixels in the left top corner instead of the mesh.

Here is my sourcecode:

Code: Select all

#include <OpenGL/OpenGL.h>
#include <irrlicht.h>
#include <iostream>

using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
/*
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#else*/
#pragma comment(lib, "libIrrlicht.a")
/*#endif*/

// resPath returns the Path for a resource file "file"
char * resPath( char** argv, char* file )
{
    // returns the path to the "Resources" directory
	char	tempPath[1024];
	strncpy( tempPath, argv[0], 1023 );
	int	x = strlen(tempPath) -1;
	while( tempPath[x] != '/' && x > 0 )
		tempPath[x--] = 0;
	
	strncat( tempPath, "../Resources/", 1023 );
	return strncat( tempPath, file, 1023 );
}


int main(int argc, char** argv)
{
	// setting up the device
	IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d<s32>(512, 384), 16, false, false, false, 0);
	device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
	
	// getting the driver and scenemanager
	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();
	
	// if I include the GUI Enviroment, the sample mesh will dissapear, if a texture is loaded
	//IGUIEnvironment* guienv = device->getGUIEnvironment();
	//guienv->addStaticText(L"Hello World! This is the Irrlicht Software engine!", rect<s32>(10,10,200,22), true);
	
	// loading the mesh works great
	IAnimatedMesh* mesh = smgr->getMesh(resPath(argv,"sydney.md2") );
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
	
	if (node) {
		// setting the lighting to true hides the complete scene, as espected
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setFrameLoop(0, 310);
		
		
// -- PROBLEM --

		// so here is the problem: there is no error, but the mesh displays in white without any texture!
		node->setMaterialTexture( 0, driver->getTexture(resPath(argv,"sydney.bmp")) );
	}
	
	smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
	
	while(device->run()) {
		driver->beginScene(true, true, SColor(255,100,101,140));
		smgr->drawAll();
		//guienv->drawAll();
		driver->endScene();
	}
	
	device->drop();
	return 0;
}
can anyone help me please?

thanks...
Micha
Post Reply