Pages: [1] 2
|
|
|
Author
|
Topic: Problems compiling on Mac OS 10.13.3 (Read 4949 times)
|
Kanhef
Zebranky food
Offline
Posts: 13
|
So, I'm trying to build from source after making a few changes, and I've run into a familiar-looking error or two. When running ./build.sh uqm config it gives me fatal error: "SDL/SDL_version.h" file not found Also, Rez is not found.
As per the installation instructions included with source, SDL and SDL_image have been placed in /Library/Frameworks. Instructions say SDL-devel is optional, so it is not installed. I've tried using CFLAGS to include the SDL headers directory, but it has no effect on the output.
Having read through much of this forum, I see that a number of people have had similar issues over the years, and a few even seem to have resolved them, but it is unclear how. This post seems to reference the issues I'm having, but doesn't say how to fix them. Detailed instructions on how to get everything where the build script can find it would be much appreciated. I'd prefer to not have to install fink/macports/etc just for this one thing, but can if it's the only way to make it work.
|
|
|
Logged
|
|
|
|
|
Kanhef
Zebranky food
Offline
Posts: 13
|
UQM 0.7.0-1
Also, which version of SDL and SDL-image should be used? http://sc2.sourceforge.net/downloads.php says SDL-image 1.2.10, but INSTALL.macosx says there are issues with anything after SDL-image 1.2.7 .
Thanks!
|
|
|
Logged
|
|
|
|
|
Kanhef
Zebranky food
Offline
Posts: 13
|
Well, it gets through config now, after some tweaking. In config_proginfo_host:
LIB_SDL_LDFLAGS='-F/Library/Frameworks -framework SDL -framework Cocoa -lobjc' Preprocessor is throwing a fit with "unterminated conditional directive" errors. Noticed that I have a somewhat older version of Xcode installed, updating it to see if that fixes things.
|
|
|
Logged
|
|
|
|
|
Kanhef
Zebranky food
Offline
Posts: 13
|
So, somehow a newline got deleted from src/libs/compiler.h, putting a #endif on the same line as a #define. No wonder the preprocessor had issues.
Adapted your fix to set LIB_SDL_image_CFLAGS and LDFLAGS. A few warnings, most of which look relatively inconsequential (though the array bounds violation in src/libs/input/sdl/vcontrol.c:1266 might cause issues). Only error is that it's trying to compile Ogg Vorbis support, even though that's supposed to be optional and it's configured not to use Ogg. Ah well, not the worst thing to have to deal with.
Edit: A bit less straightforward than I expected. Building Ogg/Vorbis only seems to produce x86-64 code, but UQM needs a i386 library to link to. Can't seem to find a precompiled framework, except for one that's meant for iOS. Even with that, linking fails: Undefined symbols for architecture i386: "_IMG_Load_RW", referenced from: _sdluio_loadImage in sdluio.c.o There are a bunch more similar errors if I configure it to not use Ogg, all from oggaud.c
|
|
« Last Edit: August 18, 2018, 08:17:31 pm by Kanhef »
|
Logged
|
|
|
|
CelticMinstrel
Enlightened
Offline
Posts: 522
|
That missing symbol is from SDL_Image - do you have that installed?
|
|
|
Logged
|
|
|
|
Kanhef
Zebranky food
Offline
Posts: 13
|
Yeah, it compiles to object code just fine, so it's finding the SDL image header files, but it seems like it can't find the shared library when it goes to link everything. The build script is fairly convoluted, so I'm having trouble understanding what exactly is going on at this step, and why it doesn't work right.
|
|
|
Logged
|
|
|
|
|
Kanhef
Zebranky food
Offline
Posts: 13
|
SDL 1.2.15, SDL-image 1.2.12
|
|
|
Logged
|
|
|
|
|
Kanhef
Zebranky food
Offline
Posts: 13
|
Fresh copy of source plus Sarosis' config files.
Config fails: Simple DirectMedia Layer not found.
Add '-F/Library/Frameworks' to LIB_SDL_LDFLAGS in config_proginfo_host. Get errors about 'SDL/SDL.h' not found.
Okay, the full path to SDL.h is /Library/Frameworks/SDL.framework/Versions/Current/Headers/SDL.h, not contained in an SDL directory. 'cd /Library/Frameworks/SDL.framework/Headers ; ln -s . SDL' makes a symlink so the path will resolve.
No more SDL.h errors, but can't find 'SDL_image/SDL_image.h'.LIB_SDL_image_CFLAGS='-I/Library/Frameworks/SDL_image.framework/Headers' LIB_SDL_image_LDFLAGS='-F/Library/Frameworks -framework SDL_image' And the same symlink trick.
Compiles and links. Okay, pull out FileMerge to figure out what's different.
Derp.
Lib_SDL_image_LDFLAGS="-F/Library/Frameworks -framework SDL
Copy-and-paste without double-checking got me. Working 50-60 hour weeks probably hasn't been helping either.
Try to install, can't find SDL/SDL.h and SDL_image/SDL_image.h again. Looking at build.config, it's trying to copy frameworks into the app, but nothing in the command to locate them is telling it to look in /Library/Frameworks, rather than the standard include directories.
|
|
|
Logged
|
|
|
|
|
Kanhef
Zebranky food
Offline
Posts: 13
|
Compiling process is working; it doesn't find the frameworks without using -I. Current hangup is in this part of build.config: # Find Frameworks and copy them into the application. echo "Copying dependancy Frameworks..." >&2 HEADERS="ogg/ogg.h SDL.h SDL_image.h vorbis/vorbisfile.h" if [ "$uqm_SOUNDMODULE" = openal ]; then HEADERS="$HEADERS OpenAL/al.h" fi for HEADER in $HEADERS; do HEADER_FILE=`basename $HEADER` eval FRAMEWORK=`echo '' | \ $PREPROC_C -D__MACOSX__ -include $HEADER - | \ awk '(/'$HEADER_FILE'/ && $2 == 1) { print $3; exit }' | \ $SED 's/.Headers.*$/"/'` cp -r "$FRAMEWORK" "$INSTROOT/Frameworks" done It's checking standard include directories, but not /Library/Frameworks/ .
|
|
|
Logged
|
|
|
|
Pages: [1] 2
|
|
|
|
|