Building on Leopard. SDL problem.

Questions or HOWTOs about the above? Post 'em here...
Post Reply
xxryan9559xx
Private
Private
Posts: 2
Joined: Fri Oct 12, 2007 12:52 am

Building on Leopard. SDL problem.

Post by xxryan9559xx »

I recently got an iMac with OS X leopard(10.5). When I try to use Xcode 3.0 or a command line to build it, I get errors about SDL. I put it in both frameworks folder, /Library/Frameworks and /System/Library/Frameworks. OS X says its installed, but BZFlag can't find it. If I use the prebuilt .app from the DMG it works fine. Any ideas on whats wrong?
ts
Dev Monkey
Dev Monkey
Posts: 970
Joined: Fri Jan 14, 2005 6:26 pm

Post by ts »

You need the development version of SDL. Check if you have sdl-config installed. Last time I checked SDL wasn't building in 10.5 so I ended up with modifying SDL to build.

Probably a package manager like macports will be able to build you a working version of SDL with sdl-config.

The following text will only apply if you're trying to build the trunk version of BZFlag:
After you solved the SDL problem your compiler will fail to build ftgl. I don't know whether there is a working version of ftgl out there, last time I checked I couldn't find one.

If you get the thing to work you'll be faced with the currupted game protocol. Clients can not join a server yet, until it is fixed.
GU league: http://www.guleague.org/
An introduction to TCP: http://www.lafkon.net/tc/
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

Code: Select all

devindelong$ sudo port install libsdl
--->  Fetching libsdl
--->  Attempting to fetch SDL-1.2.13.tar.gz from http://www.libsdl.org/release/
--->  Verifying checksum(s) for libsdl
--->  Extracting libsdl
--->  Configuring libsdl
--->  Building libsdl with target all
--->  Staging libsdl into destroot
--->  Installing libsdl 1.2.13_1
--->  Activating libsdl 1.2.13_1
--->  Cleaning libsdl

Code: Select all

./configure --enable-shared --enable-optimized --enable-plugins LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include -I/usr/local/include"
...
checking SDL/SDL.h usability... yes
checking SDL/SDL.h presence... yes
...
checking for SDL framework... no
checking for sdl-config... /opt/local/bin/sdl-config
checking for SDL - version >= 1.2.5... no
*** Could not run SDL test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means SDL was incorrectly installed
*** or that you have moved SDL since it was installed. In the latter case, you
*** may want to edit the sdl-config script: /opt/local/bin/sdl-config
configure: WARNING: could not find an appropriate SDL version. BZflag will build without SDL
configure: WARNING: Client build has been requested, but GL is not fully available (missing gl.h)
     ... disabling client generation

Both the SDL framework and the OpenGL framework were not found, but other "regular" libraries were. Is there something wrong with the configure script preventing it from finding frameworks? If I remember correctly, bzflag/trunk was able to find both SDl.framework and OpenGL.framework without installing SDL-Devel or sdl-config - only the regular SDL and OpenGL frameworks were installed.

Code: Select all

devindelong$ sdl-config --version
1.2.13
SDL version is greater than 1.2.5.


SDL-Devel Readme:

Code: Select all

This package contains:
- SDL API Documentation
- A variety of SDLMain and .Nib files to choose from
- Xcode/Project Builder project templates
Are these really necessary for bzflag to build? Doesn't bzflag have its own SDLMain?


I've been disabling sdl and the bzflag client so that plug-ins can still be built.
Last edited by Enigma on Sat Jan 19, 2008 11:29 pm, edited 1 time in total.
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

In config.log, this seems to be a common error: "ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib."

BTW, Apple's X11 now uses X.org: "X11.app 2.0 - X.org X11R7.2." In past OS versions I believe Xfree86 was used.

Code: Select all


configure:24480: g++ -o conftest -g -O2 -I/opt/local/include -I/usr/local/include -L/opt/local/lib  -L/usr/X11/lib -R/usr/X11/lib conftest.cpp -framework OpenGL  -lm  >&5
ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
collect2: ld returned 1 exit status
configure:24486: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "BZFlag"
| #define PACKAGE_TARNAME "bzflag"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "BZFlag 2.0.11"
| #define PACKAGE_BUGREPORT "http://BZFlag.org/"
| #define PACKAGE "bzflag"
| #define VERSION "2.0.11"
| #define BZ_BUILD_OS "darwin9.1.0"
| #define BZ_BUILD_USER "devindelong"
| #define BUILD_REGEX 1
| #define _USE_BZ_API 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_LIBCURL 1
| #define LIBCURL_FEATURE_SSL 1
| #define LIBCURL_FEATURE_IPV6 1
| #define LIBCURL_FEATURE_LIBZ 1
| #define LIBCURL_FEATURE_NTLM 1
| #define LIBCURL_PROTOCOL_HTTP 1
| #define LIBCURL_PROTOCOL_HTTPS 1
| #define LIBCURL_PROTOCOL_FTP 1
| #define LIBCURL_PROTOCOL_FTPS 1
| #define LIBCURL_PROTOCOL_FILE 1
| #define LIBCURL_PROTOCOL_TELNET 1
| #define LIBCURL_PROTOCOL_LDAP 1
| #define LIBCURL_PROTOCOL_DICT 1
| #define LIBCURL_PROTOCOL_TFTP 1
| #define STDC_HEADERS 1
| #define HAVE_CSTDLIB 1
| #define HAVE_CSTDIO 1
| #define HAVE_CSTRING 1
| #define HAVE_SDL_SDL_H 1
| #define HAVE_X11_XLIB_H 1
| #define HAVE_ARPA_NAMESER_COMPAT_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_UNISTD_H 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_SOCKLEN_T 1
| #define HAVE_LIBM 1
| #define HAVE_ACOSF 1
| #define HAVE_ASINF 1
| #define HAVE_ATAN2F 1
| #define HAVE_ATANF 1
| #define HAVE_COSF 1
| #define HAVE_EXPF 1
| #define HAVE_FABSF 1
| #define HAVE_FLOORF 1
| #define HAVE_FMODF 1
| #define HAVE_HYPOTF 1
| #define HAVE_LOGF 1
| #define HAVE_LOG10F 1
| #define HAVE_POWF 1
| #define HAVE_SINF 1
| #define HAVE_SQRTF 1
| #define HAVE_TANF 1
| #define HAVE_REGEX_H 1
| /* end confdefs.h.  */
| #include <OpenGL/gl.h>
| int
| main ()
| {
| glBegin(GL_POINTS)
|   ;
|   return 0;
| }

configure:25064: checking for working ncurses
configure:25094: g++ -o conftest -g -O2 -I/opt/local/include -I/usr/local/include -L/opt/local/lib  -L/usr/X11/lib -R/usr/X11/lib conftest.cpp -lm  -framework Carbon -framework Cocoa -framework OpenGL -lncurses >&5
ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
collect2: ld returned 1 exit status
configure:25100: $? = 1
configure: failed program was:
| 
| 	/* confdefs.h.  */
| #define PACKAGE_NAME "BZFlag"
| #define PACKAGE_TARNAME "bzflag"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "BZFlag 2.0.11"
| #define PACKAGE_BUGREPORT "http://BZFlag.org/"
| #define PACKAGE "bzflag"
| #define VERSION "2.0.11"
| #define BZ_BUILD_OS "darwin9.1.0"
| #define BZ_BUILD_USER "devindelong"
| #define BUILD_REGEX 1
| #define _USE_BZ_API 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_LIBCURL 1
| #define LIBCURL_FEATURE_SSL 1
| #define LIBCURL_FEATURE_IPV6 1
| #define LIBCURL_FEATURE_LIBZ 1
| #define LIBCURL_FEATURE_NTLM 1
| #define LIBCURL_PROTOCOL_HTTP 1
| #define LIBCURL_PROTOCOL_HTTPS 1
| #define LIBCURL_PROTOCOL_FTP 1
| #define LIBCURL_PROTOCOL_FTPS 1
| #define LIBCURL_PROTOCOL_FILE 1
| #define LIBCURL_PROTOCOL_TELNET 1
| #define LIBCURL_PROTOCOL_LDAP 1
| #define LIBCURL_PROTOCOL_DICT 1
| #define LIBCURL_PROTOCOL_TFTP 1
| #define STDC_HEADERS 1
| #define HAVE_CSTDLIB 1
| #define HAVE_CSTDIO 1
| #define HAVE_CSTRING 1
| #define HAVE_SDL_SDL_H 1
| #define HAVE_X11_XLIB_H 1
| #define HAVE_ARPA_NAMESER_COMPAT_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_UNISTD_H 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_SOCKLEN_T 1
| #define HAVE_LIBM 1
| #define HAVE_ACOSF 1
| #define HAVE_ASINF 1
| #define HAVE_ATAN2F 1
| #define HAVE_ATANF 1
| #define HAVE_COSF 1
| #define HAVE_EXPF 1
| #define HAVE_FABSF 1
| #define HAVE_FLOORF 1
| #define HAVE_FMODF 1
| #define HAVE_HYPOTF 1
| #define HAVE_LOGF 1
| #define HAVE_LOG10F 1
| #define HAVE_POWF 1
| #define HAVE_SINF 1
| #define HAVE_SQRTF 1
| #define HAVE_TANF 1
| #define HAVE_REGEX_H 1
| #define HAVE_GLEW 1
| /* end confdefs.h.  */
| #include <ncurses.h>
| 
| int
| main ()
| {
| chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr();
| 
|   ;
|   return 0;
| }

configure:25131: checking for working curses
configure:25161: g++ -o conftest -g -O2 -I/opt/local/include -I/usr/local/include -L/opt/local/lib  -L/usr/X11/lib -R/usr/X11/lib conftest.cpp -lm  -framework Carbon -framework Cocoa -framework OpenGL -lcurses >&5
ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
collect2: ld returned 1 exit status
configure:25167: $? = 1
configure: failed program was:
| 
| 	/* confdefs.h.  */
| #define PACKAGE_NAME "BZFlag"
| #define PACKAGE_TARNAME "bzflag"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "BZFlag 2.0.11"
| #define PACKAGE_BUGREPORT "http://BZFlag.org/"
| #define PACKAGE "bzflag"
| #define VERSION "2.0.11"
| #define BZ_BUILD_OS "darwin9.1.0"
| #define BZ_BUILD_USER "devindelong"
| #define BUILD_REGEX 1
| #define _USE_BZ_API 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_LIBCURL 1
| #define LIBCURL_FEATURE_SSL 1
| #define LIBCURL_FEATURE_IPV6 1
| #define LIBCURL_FEATURE_LIBZ 1
| #define LIBCURL_FEATURE_NTLM 1
| #define LIBCURL_PROTOCOL_HTTP 1
| #define LIBCURL_PROTOCOL_HTTPS 1
| #define LIBCURL_PROTOCOL_FTP 1
| #define LIBCURL_PROTOCOL_FTPS 1
| #define LIBCURL_PROTOCOL_FILE 1
| #define LIBCURL_PROTOCOL_TELNET 1
| #define LIBCURL_PROTOCOL_LDAP 1
| #define LIBCURL_PROTOCOL_DICT 1
| #define LIBCURL_PROTOCOL_TFTP 1
| #define STDC_HEADERS 1
| #define HAVE_CSTDLIB 1
| #define HAVE_CSTDIO 1
| #define HAVE_CSTRING 1
| #define HAVE_SDL_SDL_H 1
| #define HAVE_X11_XLIB_H 1
| #define HAVE_ARPA_NAMESER_COMPAT_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_UNISTD_H 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_SOCKLEN_T 1
| #define HAVE_LIBM 1
| #define HAVE_ACOSF 1
| #define HAVE_ASINF 1
| #define HAVE_ATAN2F 1
| #define HAVE_ATANF 1
| #define HAVE_COSF 1
| #define HAVE_EXPF 1
| #define HAVE_FABSF 1
| #define HAVE_FLOORF 1
| #define HAVE_FMODF 1
| #define HAVE_HYPOTF 1
| #define HAVE_LOGF 1
| #define HAVE_LOG10F 1
| #define HAVE_POWF 1
| #define HAVE_SINF 1
| #define HAVE_SQRTF 1
| #define HAVE_TANF 1
| #define HAVE_REGEX_H 1
| #define HAVE_GLEW 1
| /* end confdefs.h.  */
| #include <curses.h>
| 
| int
| main ()
| {
| chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr();
| 
|   ;
|   return 0;
| }

configure:25396: checking for SDL framework
configure:25422: gcc -o conftest -g -O2 -I/opt/local/include -I/usr/local/include -L/opt/local/lib  -L/usr/X11/lib -R/usr/X11/lib -framework SDL conftest.c  -lm  -framework Carbon -framework Cocoa -framework OpenGL >&5
ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib
collect2: ld returned 1 exit status
configure:25428: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "BZFlag"
| #define PACKAGE_TARNAME "bzflag"
| #define PACKAGE_VERSION "2.0.11"
| #define PACKAGE_STRING "BZFlag 2.0.11"
| #define PACKAGE_BUGREPORT "http://BZFlag.org/"
| #define PACKAGE "bzflag"
| #define VERSION "2.0.11"
| #define BZ_BUILD_OS "darwin9.1.0"
| #define BZ_BUILD_USER "devindelong"
| #define BUILD_REGEX 1
| #define _USE_BZ_API 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define HAVE_LIBCURL 1
| #define LIBCURL_FEATURE_SSL 1
| #define LIBCURL_FEATURE_IPV6 1
| #define LIBCURL_FEATURE_LIBZ 1
| #define LIBCURL_FEATURE_NTLM 1
| #define LIBCURL_PROTOCOL_HTTP 1
| #define LIBCURL_PROTOCOL_HTTPS 1
| #define LIBCURL_PROTOCOL_FTP 1
| #define LIBCURL_PROTOCOL_FTPS 1
| #define LIBCURL_PROTOCOL_FILE 1
| #define LIBCURL_PROTOCOL_TELNET 1
| #define LIBCURL_PROTOCOL_LDAP 1
| #define LIBCURL_PROTOCOL_DICT 1
| #define LIBCURL_PROTOCOL_TFTP 1
| #define STDC_HEADERS 1
| #define HAVE_CSTDLIB 1
| #define HAVE_CSTDIO 1
| #define HAVE_CSTRING 1
| #define HAVE_SDL_SDL_H 1
| #define HAVE_X11_XLIB_H 1
| #define HAVE_ARPA_NAMESER_COMPAT_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_UNISTD_H 1
| #define WORDS_BIGENDIAN 1
| #define HAVE_SOCKLEN_T 1
| #define HAVE_LIBM 1
| #define HAVE_ACOSF 1
| #define HAVE_ASINF 1
| #define HAVE_ATAN2F 1
| #define HAVE_ATANF 1
| #define HAVE_COSF 1
| #define HAVE_EXPF 1
| #define HAVE_FABSF 1
| #define HAVE_FLOORF 1
| #define HAVE_FMODF 1
| #define HAVE_HYPOTF 1
| #define HAVE_LOGF 1
| #define HAVE_LOG10F 1
| #define HAVE_POWF 1
| #define HAVE_SINF 1
| #define HAVE_SQRTF 1
| #define HAVE_TANF 1
| #define HAVE_REGEX_H 1
| #define HAVE_GLEW 1
| /* end confdefs.h.  */
| #include <SDL/SDL_version.h>
| int
| main ()
| {
| 
|   ;
|   return 0;
| }

So these programs are actually compiling but failing during the link phase, and they all have the same dumb error. As Adam from MythBusters would say, "well there's your problem!"
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

Apparently a lot of open source packages are having this problem, and it is due to a bug in leopard's developer tools. A lot of people have suggested using LDFLAGS="-dylib_file/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib: /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib". This isn't working for me though.
ts
Dev Monkey
Dev Monkey
Posts: 970
Joined: Fri Jan 14, 2005 6:26 pm

Post by ts »

I used this to build BZFlag:
export LDFLAGS=${LDFLAGS}-L/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries

I don't know whether this will work for you.
GU league: http://www.guleague.org/
An introduction to TCP: http://www.lafkon.net/tc/
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

ts wrote:I used this to build BZFlag:
export LDFLAGS=${LDFLAGS}-L/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries

I don't know whether this will work for you.
Holy cow! I think hell is a cold place right now; it seemed like a workaround for this problem didn't exist for a long time.

Code: Select all

BZFlag-2.0.11.20080119 with the following:
     curses: -lncurses
     SDL
     bzadmin
     bzflag client
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

Post by Enigma »

ts wrote: The following text will only apply if you're trying to build the trunk version of BZFlag:
After you solved the SDL problem your compiler will fail to build ftgl. I don't know whether there is a working version of ftgl out there, last time I checked I couldn't find one.
BTW, I actually have ftgl installed from macports.
Post Reply