This topic contains 11 replies, has 0 voices, and was last updated by  imported_gcamp 11 years, 1 month ago.

  • Author
    Posts
  • #4932

    Hiroyuki
    Participant

    Can anyone give me a brief tutorial on how to build scorched under osx – preferably using xcode (I recently moved from unix -> osx and have some trouble…. ) As for using makefiles, i stumble at the OpenAL part, as I seem to be unable to compile OpenAL correctly (using xcode it works fine, but that doesn’t give me the openal libraries the way scorched wants them… )

    #34956

    imported_gcamp
    Participant

    Hi Hiroyuki,

    I’ve only compiled on OSX using gcc, but it seemed fairly ok.

    You shouldn’t need to compile openal as it now comes on some mac platforms and is avialable for others. see : http://developer.apple.com/audio/openal.html

    I had to compile SDL, SDL_net, wxMac and freetype. You will probably want to compile them for static libraries if you want to make the redistribution easier.

    I have a compiled and working version of 40.1d for the mac, I am just waiting to see if this is the last 40.1 version before I release.

    regards,
    Gavin

    #34957

    Hiroyuki
    Participant

    Hmm… do you use the ./configure script, or manually edit the makefile? because the install of openAL doesn’t include the openal-config file which configure is searching for… – otherwise, how do i link to the openal library on osx?

    I’m getting frustrated with the slight differences from normal unixes… thought this my be stupid question to ask, cause i do not have much experience with porting things on osx… only a bit on Solaris, BSD and linux…

    #34958

    imported_gcamp
    Participant

    Good question, I kind of hacked around it. I just downloaded the one from CVS and edited it to point to the correct mac implementation (-framework OpenAL).

    The mac does seem slightly different from other linux platforms and while the scorched3d configure script will allow the game to compile fine I still have to edit the link line to get it to link. I know this is not ideal but I have only just aquired a mac so I can mess around a bit easier.

    For reference these are the libs I use


    LIBS = -L/usr/local/lib /usr/local/lib/libSDLmain.a /usr/local/lib/libSDL.a /usr/local/lib/libSDL_net.a -framework Cocoa -framework OpenGL -lGL -lGLU -lpthread -L/usr/lib -framework OpenAL -L/opt/wxMac-2.6.1/osx-build/lib -framework QuickTime -framework IOKit -framework Carbon -framework Cocoa -framework System /opt/wxMac-2.6.1/osx-build/lib/libwx_mac_xrc-2.6.a /opt/wxMac-2.6.1/osx-build/lib/libwx_mac_qa-2.6.a /opt/wxMac-2.6.1/osx-build/lib/libwx_mac_html-2.6.a /opt/wxMac-2.6.1/osx-build/lib/libwx_mac_adv-2.6.a /opt/wxMac-2.6.1/osx-build/lib/libwx_mac_core-2.6.a /opt/wxMac-2.6.1/osx-build/lib/libwx_base_carbon_xml-2.6.a /opt/wxMac-2.6.1/osx-build/lib/libwx_base_carbon_net-2.6.a /opt/wxMac-2.6.1/osx-build/lib/libwx_base_carbon-2.6.a -framework WebKit -lwxexpat-2.6 -lwxtiff-2.6 -lwxjpeg-2.6 -lwxpng-2.6 -lpthread -liconv -L/usr/local/lib /usr/local/lib/libfreetype.a
    #34959

    Hiroyuki
    Participant

    Oh well, now I think i’ve spent enough time trying to figure this out…. I give up; But thanks a lot gavin for your help, it did help me make some progress… but i keep stumbeling upon some problems here… so… I guess OSX compiling isn’t my cup of tea

    #34960

    imported_gcamp
    Participant

    I’m sorry to hear that, let me know if there’s any other help I can give.

    #34961

    Hiroyuki
    Participant

    Thanks, I’ll let it rest for now… maybe i’ll give it a shot again in a couple of days…. failing to compile stuff which seems to work out for everyone else arises my curiousity of what I have done wrong 😀

    #34962

    Hiroyuki
    Participant

    Ok, I’ve gotten as far as to get the code to compile with 2 errors…

    if g++ -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DPACKAGE="scorched3d" -DVERSION="40" -DHAVE_OGG=1 -DHAVE_VSNPRINTF=1 -DHAVE_SNPRINTF=1 -DHAVE_VASPRINTF=1 -DHAVE_ASPRINTF=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1  -I. -I. -I../porting -I..   -I/usr/X11R6/include -I/usr/X11R6 -I/usr/local/include -D__DARWIN__ -I/sw/lib/wx/include/mac-ansi-release-2.6 -I/sw/include/wx-2.6 -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA  -g -O2 -I/sw/include/SDL -D_THREAD_SAFE  -I/sw/lib/wx/include/mac-ansi-release-2.6 -I/sw/include/wx-2.6 -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA   -I/usr/local/include/freetype2 -I/usr/local/include -DS3D_DOCDIR="/usr/local/games/scorched3d/share/documentation" -DS3D_DATADIR="/usr/local/games/scorched3d/share" -DS3D_BINDIR="/usr/local/games/scorched3d/bin" -DdDOUBLE -MT GLStateExtension.o -MD -MP -MF ".deps/GLStateExtension.Tpo" -c -o GLStateExtension.o `test -f '../GLEXT/GLStateExtension.cpp' || echo './'`../GLEXT/GLStateExtension.cpp; 
    then mv -f ".deps/GLStateExtension.Tpo" ".deps/GLStateExtension.Po"; else rm -f ".deps/GLStateExtension.Tpo"; exit 1; fi
    ../GLEXT/GLStateExtension.cpp: In static member function 'static void GLStateExtension::setup()':
    ../GLEXT/GLStateExtension.cpp:101: error: invalid conversion from 'int*' to 'GLint*'
    ../GLEXT/GLStateExtension.cpp:101: error: initializing argument 2 of 'void glGetIntegerv(GLenum, GLint*)'
    make[3]: [GLStateExtension.o] Error 1 (ignored)

    and

    if g++ -DPACKAGE_NAME="" -DPACKAGE_TARNAME="" -DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT="" -DPACKAGE="scorched3d" -DVERSION="40" -DHAVE_OGG=1 -DHAVE_VSNPRINTF=1 -DHAVE_SNPRINTF=1 -DHAVE_VASPRINTF=1 -DHAVE_ASPRINTF=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1  -I. -I. -I../porting -I..   -I/usr/X11R6/include -I/usr/X11R6 -I/usr/local/include -D__DARWIN__ -I/sw/lib/wx/include/mac-ansi-release-2.6 -I/sw/include/wx-2.6 -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA  -g -O2 -I/sw/include/SDL -D_THREAD_SAFE  -I/sw/lib/wx/include/mac-ansi-release-2.6 -I/sw/include/wx-2.6 -D__WXMAC__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA   -I/usr/local/include/freetype2 -I/usr/local/include -DS3D_DOCDIR="/usr/local/games/scorched3d/share/documentation" -DS3D_DATADIR="/usr/local/games/scorched3d/share" -DS3D_BINDIR="/usr/local/games/scorched3d/bin" -DdDOUBLE -MT GLVertexArray.o -MD -MP -MF ".deps/GLVertexArray.Tpo" -c -o GLVertexArray.o `test -f '../GLEXT/GLVertexArray.cpp' || echo './'`../GLEXT/GLVertexArray.cpp; 
    then mv -f ".deps/GLVertexArray.Tpo" ".deps/GLVertexArray.Po"; else rm -f ".deps/GLVertexArray.Tpo"; exit 1; fi
    ../GLEXT/GLVertexArray.cpp: In destructor 'virtual GLVertexArray::~GLVertexArray()':
    ../GLEXT/GLVertexArray.cpp:60: error: invalid conversion from 'unsigned int*' to 'const GLuint*'
    ../GLEXT/GLVertexArray.cpp:61: error: invalid conversion from 'unsigned int*' to 'const GLuint*'
    ../GLEXT/GLVertexArray.cpp:62: error: invalid conversion from 'unsigned int*' to 'const GLuint*'
    ../GLEXT/GLVertexArray.cpp: In member function 'virtual void GLVertexArray::setup()':
    ../GLEXT/GLVertexArray.cpp:100: error: invalid conversion from 'unsigned int*' to 'GLuint*'
    ../GLEXT/GLVertexArray.cpp:111: error: invalid conversion from 'unsigned int*' to 'GLuint*'
    ../GLEXT/GLVertexArray.cpp:122: error: invalid conversion from 'unsigned int*' to 'GLuint*'
    make[3]: [GLVertexArray.o] Error 1 (ignored)

    Any solutions to how i can resolve this problem?

    #34963

    imported_gcamp
    Participant

    I guess you could probably change the code to do something like for each occurance:-


    GLint textureUnits;
    glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &textureUnits);
    textureUnits_ = textureUnits;

    I would be interested in what this command gives :-

    grep "typedef.*GLint" /usr/X11R6/include/GL/gl.h
    #34964

    Hiroyuki
    Participant

    grep "typedef.*GLint" /usr/X11R6/include/GL/gl.h
    typedef int GLint; /* 4-byte signed */
    typedef void (APIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
    typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
    typedef void (APIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
    typedef void (APIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
    typedef void (APIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
    typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
    typedef void (APIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
    typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
    typedef void (APIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
    typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
    typedef void (APIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
    typedef void (APIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
    typedef void (APIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
    typedef void (APIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
    typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
    typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
    typedef void (APIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
    typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
    typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
    typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
    typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
    typedef void (APIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
    #34965

    imported_gcamp
    Participant

    typedef int GLint;

    Strange, they should be equal types then.

    #34966

    Hiroyuki
    Participant

    Ok, the GLint & GLuint did the trick, now i got it compiled and working, thanks a lot for your help Gavin…

    #34967

    imported_gcamp
    Participant

    Hurrah, hugs all round 🙂

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.