Crashes on Mac OSX

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Crashes on Mac OSX

Post by MolokoTheMole »

Hi,
I just compiled my game for Mac OSX using Irrlicht 1.7.2.
Many people report crashes and can't start the game. It works fine for me on an old Macbook. Tested it on a Macbook Air, doesn't work.
Here are the typical crash reports they are getting:

Model: Macmini2,1, BootROM MM21.009A.B00, 2 processors, Intel Core 2 Duo, 2 GHz, 2 GB, SMC 1.19f2
Graphics: Intel GMA 950, GMA 950, Built-In, spdisplays_integrated_vram
OS Version: Mac OS X 10.6.8 (10K549)
[0] Initializing new video device...
[0] Irrlicht Engine version 1.7.2
[0] Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
dyld: lazy symbol binding failed: Symbol not found: _CGLSetCurrentContext
Referenced from: /Applications/KAG.app/Contents/MacOS/Base/Juxta.dylib
Expected in: /usr/X11/lib/libGL.1.dylib

dyld: Symbol not found: _CGLSetCurrentContext
Referenced from: /Applications/KAG.app/Contents/MacOS/Base/Juxta.dylib
Expected in: /usr/X11/lib/libGL.1.dylib
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Crashes on Mac OSX

Post by hybrid »

I don't have a newer OSX system, so I cannot test those cases. But it seems that some OpenGL libs are simply missing here.
Ricket
Posts: 8
Joined: Thu Nov 06, 2008 7:43 pm
Location: North Carolina, USA

Re: Crashes on Mac OSX

Post by Ricket »

I believe you are missing the Cocoa framework, or maybe Carbon. You'll also need the IOKit framework for part of Irrlicht, but given that you're doing lazy linking (which is new to me, actually), you may not run into that requirement unless you support joysticks. Those are the three required frameworks for Irrlicht that I've found (via experimentation).
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Re: Crashes on Mac OSX

Post by MolokoTheMole »

Here is what I'm linking against:

-lGL -lXxf86vm -lobjc -framework cocoa -framework carbon -framework opengl -framework IOKit

I do support joysticks, is that a problem?
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
Ricket
Posts: 8
Joined: Thu Nov 06, 2008 7:43 pm
Location: North Carolina, USA

Re: Crashes on Mac OSX

Post by Ricket »

Are they actually case-insensitive like that? I would think the lowercase "cocoa", "carbon" and "opengl" could mess up at least most systems. IOKit is capitalized correctly, as is objc. And no, I don't believe it's a problem, I was simply saying that (I think) IOKit is only necessary for joystick stuff; so in your case, it's crucial that you do link with it.

If capitalizing fixes it, I dunno; I'm using CMake so it kinda happens magically, which I like.
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Re: Crashes on Mac OSX

Post by MolokoTheMole »

So what case should it be? Would you mind pasting me the CMake lines where the linking is done?
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
Ricket
Posts: 8
Joined: Thu Nov 06, 2008 7:43 pm
Location: North Carolina, USA

Re: Crashes on Mac OSX

Post by Ricket »

CMake is complicated and I'm rather new at it, but I think this is the relevant linking bit that you need:

Code: Select all

-lIrrlicht -framework AGL -framework OpenGL -framework Carbon -framework Cocoa -framework IOKit
Here is my main CMakeLists.txt file, in case you or someone else reading this wants to use CMake. It seems to work well.

Code: Select all

cmake_minimum_required(VERSION 2.8)
PROJECT(ArcaneTrinity)
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
 
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(Irrlicht)
FIND_PACKAGE(MsgPack)
 
IF (APPLE)
        FIND_LIBRARY(CARBON_LIBRARY Carbon)
        FIND_LIBRARY(COCOA_LIBRARY Cocoa)
        FIND_LIBRARY(IOKIT_LIBRARY IOKit)
        SET(OSX_LIBRARIES ${CARBON_LIBRARY} ${COCOA_LIBRARY} ${IOKIT_LIBRARY})
        
        SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
ENDIF (APPLE)
 
INCLUDE_DIRECTORIES(${IRRLICHT_INCLUDE_DIR} ${MSGPACK_INCLUDE_DIR}
        ${OPENGL_INCLUDE_DIR})
 
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
 
ADD_SUBDIRECTORY(src)
oeginc
Posts: 1
Joined: Thu Nov 17, 2011 1:36 am

Re: Crashes on Mac OSX

Post by oeginc »

I can NOT for the life of me seem to get cmake to work with Irrlicht on OSX.... Complains about missing frameworks, etc.. Does anyone have a sample tar.gz (HelloWorld for example) that works that I can expand on? Thanks!

P.S. A Cmake config that compiles Irrlicht would be awesome too, but I'm not getting my hopes up. ;)

P.S.S. I'm new to Cmake as well, but it seems as though your example above is missing something. You are finding the libraries, but I don't see where you are using them - or am I missing something?
Ricket
Posts: 8
Joined: Thu Nov 06, 2008 7:43 pm
Location: North Carolina, USA

Re: Crashes on Mac OSX

Post by Ricket »

Hi oeginc, let's not hijack this thread. Hopefully the arguments I provided earlier will help MolokoTheMole; as for CMake, since you're interested, read this thread. I just made a Github project that should help you.
Post Reply