Compilation errors on OSX 10.6.8

edited 2011 Sep 13 in Technical Support
Hello there,

I'm trying to build deng-1.9.0-beta6.9 on Mac OSX 10.6.8. Xcode version is 3.2.6.
I have of course installed the required frameworks (libsdl, sdl_net, sdl_mixer, libpng) and I'm using cmake 2.8.5, along with gcc 4.2.1.
The problem is that I get some errors about incomplete types during the building process:

/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c: In function ‘PNG_Load’:
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:122: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:127: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:127: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:132: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:133: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:143: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:144: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:145: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:157: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:157: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:161: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:163: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:164: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:170: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:171: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:172: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:174: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:175: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:176: error: dereferencing pointer to incomplete type
/Users/alfayate/Downloads/deng-1.9.0-beta6.9/doomsday/engine/portable/src/gl_png.c:183: error: dereferencing pointer to incomplete type
make[2]: *** [CMakeFiles/doomsday.dir/engine/portable/src/gl_png.o] Error 1
make[1]: *** [CMakeFiles/doomsday.dir/all] Error 2
make: *** [all] Error 2

any ideas on how to finally build it?

Comments

  • What flags are you building it with? Doomsday is regularly compiled on OS X and AFAIK this isn't normally reported as an error.
  • Also, using the latest source from the master branch would be a safer bet. I'm not sure if Beta 6.9 was ever built against the Snow Leopard SDK, just 10.4.

    Of course, you'll need Git to access the sources.
  • What's the git repository address? And better yet, is there a updated github mirror? Thanks
  • vanfanel wrote:
    What's the git repository address? And better yet, is there a updated github mirror? Thanks
    I'd guess you can find it here: http://sourceforge.net/scm/?type=git&group_id=74815
  • I cloned the GIT repository, and tried to build that version, but this is what I get:
    sh-3.2# cmake ..
    -- Making a 32-bit build only.
    -- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
    -- Check if the system is big endian
    -- Searching 16 bit integer
    CMake Error at /usr/local/share/cmake-2.8/Modules/TestBigEndian.cmake:44 (MESSAGE):
      no suitable type found
    Call Stack (most recent call first):
      CMakeLists.txt:302 (TEST_BIG_ENDIAN)
    
    
    -- Configuring incomplete, errors occurred!
    

    I believe I must pass some options to cmake (32bits only? Snow Leopard is 64bits), but I can't find them.
  • Try removing your existing CMakeCache.txt and running cmake like this:
    cmake -D MACOS_VERSION=10.6 ..
    
  • almost there! It now says it's missing the sdl framework, but it's there:
    [ 35%] Building CXX object CMakeFiles/doomsday.dir/engine/mac/src/StartupWindowController.m.o
    [ 36%] Building C object CMakeFiles/doomsday.dir/engine/mac/src/qt.c.o
    Linking CXX executable doomsday
    ld: framework not found SDL
    collect2: ld returned 1 exit status
    make[2]: *** [doomsday] Error 1
    make[1]: *** [CMakeFiles/doomsday.dir/all] Error 2
    make: *** [all] Error 2
    sh-3.2# ls /Library/Frameworks/
    .DS_Store                   SDL.framework/              libpng.framework/           libpng15.framework/
    NyxAudioAnalysis.framework/ SDL_mixer.framework/        libpng12.framework/         
    PluginManager.framework/    SDL_net.framework/          libpng14.framework/         
    sh-3.2# ls /Library/Frameworks/SDL.framework/
    Headers/   Resources/ SDL        Versions/  
    sh-3.2# 
    

    BTW, how can I tell CMAKE to build a version without SDL_net? It's supposed to be optional but I can't find the right parameter.
  • I think the problem is that CMakeLists.txt assumes that the SDL frameworks are under ~/Library/Frameworks. You should copy or create symbolic links for the SDL frameworks under that directory.

    Using SDL_net is currently mandatory.

    BTW: CMake and SDL on the whole are on their way out, we will be switching to qmake in the near future.
  • Great, it now compiled but I can't load a WAD file. It's looking for libraries in /usr/lib and /usr/local/lib but I don't know what libraries this executable is looking for, or where to point it for them:
    ./doomsday -game jdoom -file /Users/alfayate/games/doom/doom1.wad 
    Z_Create: New 32.0 MB memory volume.
    determineGlobalPaths: Base path = /Users/alfayate/doomsday/mybuild/
    Con_Init: Initializing the console.
    Executable: 1.9.7 (Unstable 32-bit) Sep 12 2011 12:05:30.
    Sys_InitWindowManager: Using SDL window management.
    While opening dynamic library
    :
      dlopen(, 2): no suitable image found.  Did find:
    	/usr/local/lib/: not a file
    	/usr/lib/: not a file
    loadGamePlugin: Loading of jdoom failed ((null)).
    Error loading game library.Z_Shutdown: Used 1 volumes, total 33554432 bytes.
    
  • That looks like it's confused about where to load the dynamic libs (game + other plugins). With the Mac build it is not possible to run the game directly from the command line like you attempted. Instead, you need to run doomsday using the bundled Doomsday.app, which contains the frameworks and built plugins.

    In the directory where Doomsday.app was created (the build dir):
    Doomsday.app/Contents/MacOS/Doomsday -appdir . -game jDoom.bundle -iwad /path-to-your-iwads/Doom.wad -file doomsday.pk3 jdoom.pk3 -bd Doomsday.app/Contents/Resources   
    
  • Great! That worked at last, now running my own compile (with SDL_GL_SetAttribute (SDL_GL_SWAP_CONTROL, 1), ie vsync on).

    Thanks a lot! :)
Sign In or Register to comment.