Page 1 of 1

Compiling using xcodebuild on Mac OS 10.4 Intel

Posted: Thu Dec 20, 2007 11:47 pm
by dgmul
Hey there!

I own a 20" first generation Intel iMac. I tried to compile BZFlag 2.0.10 from source using XCode, but I got an error while it was compiling. If anyone with any knowledge on this matter would be kind enough to give me any help, it would be greatly appreciated!

Here's the error:

Code: Select all

OpenGLGState.cxx:1582:24: error: GL/glx.h: No such file or directory
OpenGLGState.cxx:1582:24: error: GL/glx.h: No such file or directory
 g++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -DINSTALL_DATA_DIR=\"/usr/local/share/bzflag\" -fsigned-char -Wno-deprecated -g -O2 -pipe -pedantic -fno-exceptions -W -Wall -Wundef -Wno-import -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -O0 -c RenderNode.cxx  -fno-common -DPIC -o .libs/RenderNode.o
 g++ -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -DINSTALL_DATA_DIR=\"/usr/local/share/bzflag\" -fsigned-char -Wno-deprecated -g -O2 -pipe -pedantic -fno-exceptions -W -Wall -Wundef -Wno-import -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -O0 -c RenderNode.cxx -o RenderNode.o >/dev/null 2>&1
OpenGLGState.cxx: In static member function 'static bool OpenGLGState::haveGLContext()':
OpenGLGState.cxx:1597: error: 'glXGetCurrentContext' was not declared in this scope
OpenGLGState.cxx: In static member function 'static bool OpenGLGState::haveGLContext()':
OpenGLGState.cxx:1597: error: 'glXGetCurrentContext' was not declared in this scope
OpenGLGState.cxx:1602: warning: control reaches end of non-void function
OpenGLGState.cxx:1602: warning: control reaches end of non-void function
lipo: can't open input file: /var/tmp//ccnSuCPu.out (No such file or directory)
make[2]: *** [OpenGLGState.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
** BUILD FAILED **

Posted: Thu Dec 20, 2007 11:50 pm
by macsforme
Do you have the latest version of Xcode/Developer Tools?

Alternatively, if you just need a binary, you could use our test binary at http://beta.bzflag.bz/builds/2.0.x/MacO ... 2.0.10.dmg

Posted: Thu Dec 20, 2007 11:51 pm
by dgmul
Constitution wrote:Do you have the latest version of Xcode/Developer Tools?
Hm, don't know. How would I find that out?

Posted: Thu Dec 20, 2007 11:55 pm
by macsforme
dgmul wrote:
Constitution wrote:Do you have the latest version of Xcode/Developer Tools?
Hm, don't know. How would I find that out?
Your Xcode tools should have a version in the readme somewhere... compare that to the version of the latest download from Apple.

It looks like the compiler can't find your OpenGL headers, which is strange. Perhaps you could attach the entire output?

Posted: Fri Dec 21, 2007 12:03 am
by dgmul
Turns out I have XCode 2.2.1. The newest version is apparently XCode 3.0, but that is a part of Mac OS 10.5 Leopard, and I have Mac OS 10.4 Tiger. To upgrade to XCode 3.0 I would have to buy Leopard.

Attached is the entire output.

Posted: Fri Dec 21, 2007 12:18 am
by macsforme
dgmul wrote:Turns out I have XCode 2.2.1.
I believe the latest Xcode tools for Tiger is version 2.5... see http://developer.apple.com/tools/download/

It looks indeed like XCode can't find your OpenGL headers.

Code: Select all

checking GL/glx.h usability... no
checking GL/glx.h presence... no
checking for GL/glx.h... no
These should be included with Xcode (any version), so the issue is confusing. Try updating to the latest Xcode tools, and if you still can't build, you might try building from the command line first (and then using Xcode to create the final package).

Posted: Fri Dec 21, 2007 2:17 pm
by optic delusion
Copy SDL.framework to /Library/Frameworks

Posted: Fri Dec 21, 2007 9:55 pm
by dgmul
Optic Delusion wrote:Copy SDL.framework to /Library/Frameworks
Yeah, I had done that.

Now I get a different looking error with XCode 2.5, which is attached.

Posted: Fri Dec 21, 2007 11:53 pm
by DTRemenak
It looks like it's not configured correctly. Macs should not be using GLX calls, they should be using Apple's GL Framework. Try re-running configure and/or editing config.h as applicable.

Posted: Sat Dec 22, 2007 2:39 am
by dgmul
DTRemenak wrote:It looks like it's not configured correctly. Macs should not be using GLX calls, they should be using Apple's GL Framework. Try re-running configure and/or editing config.h as applicable.
How might one go about doing that?

Posted: Sun Dec 23, 2007 3:23 am
by blast
dgmul wrote:
DTRemenak wrote:It looks like it's not configured correctly. Macs should not be using GLX calls, they should be using Apple's GL Framework. Try re-running configure and/or editing config.h as applicable.
How might one go about doing that?
To run configure, launch Terminal.app. Then, cd into the BZFlag source directory, and run ./configure

Posted: Sun Dec 30, 2007 12:56 am
by dgmul
Whoops, attached the wrong error there in my last post.

Attached is the output I get for "xcodebuild" using XCode 2.5, and then the output I get when I reconfigure, and try to build using "make".

Posted: Sun Dec 30, 2007 3:25 am
by Enigma

Code: Select all

cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/Developer/usr/bin/../libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_curl_easy_cleanup
_curl_easy_getinfo
_curl_easy_init
_curl_easy_perform
_curl_easy_setopt
_curl_formadd
_curl_formfree
_curl_global_init
_curl_multi_add_handle
_curl_multi_fdset
_curl_multi_info_read
_curl_multi_init
_curl_multi_perform
_curl_multi_remove_handle
_curl_version

You don't have a universal binary of libcurl; you are missing the ppc part.