Compiling in OSX

Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Compiling in OSX
PostPosted: Sun Nov 05, 2006 1:09 pm 
User avatar
Blistered

Current Scorched3D Rank: Unranked





Joined: Fri Nov 03, 2006 4:34 pm
Posts: 44
Location: Norway
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... )


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 06, 2006 5:11 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 06, 2006 7:39 pm 
User avatar
Blistered

Current Scorched3D Rank: Unranked





Joined: Fri Nov 03, 2006 4:34 pm
Posts: 44
Location: Norway
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...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 06, 2006 8:20 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
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
Code:
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 2:12 am 
User avatar
Blistered

Current Scorched3D Rank: Unranked





Joined: Fri Nov 03, 2006 4:34 pm
Posts: 44
Location: Norway
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 2:31 am 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
I'm sorry to hear that, let me know if there's any other help I can give.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 3:24 am 
User avatar
Blistered

Current Scorched3D Rank: Unranked





Joined: Fri Nov 03, 2006 4:34 pm
Posts: 44
Location: Norway
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 :D


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 11:15 pm 
User avatar
Blistered

Current Scorched3D Rank: Unranked





Joined: Fri Nov 03, 2006 4:34 pm
Posts: 44
Location: Norway
Ok, I've gotten as far as to get the code to compile with 2 errors...
Code:
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
Code:
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?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 11:55 am 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
I guess you could probably change the code to do something like for each occurance:-

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


I would be interested in what this command gives :-

Code:
grep "typedef.*GLint" /usr/X11R6/include/GL/gl.h


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 11:56 am 
User avatar
Blistered

Current Scorched3D Rank: Unranked





Joined: Fri Nov 03, 2006 4:34 pm
Posts: 44
Location: Norway
Code:
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);


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 12:03 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
Quote:
typedef int GLint;


Strange, they should be equal types then.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 12:23 pm 
User avatar
Blistered

Current Scorched3D Rank: Unranked





Joined: Fri Nov 03, 2006 4:34 pm
Posts: 44
Location: Norway
Ok, the GLint & GLuint did the trick, now i got it compiled and working, thanks a lot for your help Gavin...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 08, 2006 5:28 pm 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
Hurrah, hugs all round :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group