Page 1 of 1

Building Exult on OSX: error compiling shapelst.cc

Posted: Thu Jun 02, 2011 3:49 pm
by howlingmime
Hey all,

[obligatory first post nonsense] I've been an Exult fan for years now, having (finally) played through all of Ultima 7 using Exult a few years back.

I've worked on a mod using earlier versions of Exult Studio on Windows and want to revisit the project on a Mac, so I'm looking to compile the system under OSX.

The problem I'm having is one that I was able to resolve for earlier compilation steps by #including SDL.h in those files, but that's not working for this error.

When I run make, it gets through about half of the files, but then stops dead on this step:

...
Making all in mapedit
g++ -DHAVE_CONFIG_H -I. -I.. -I./../headers -I./.. -I./../shapes -I./../imagewin -I./../conf -I./../gamemgr -I./../files -I./../server -I./../usecode -I./../shapes/shapeinf -D_REENTRANT -I/usr/local/Cellar/libglade/2.6.4/include/libglade-2.0 -I/usr/local/Cellar/gtk+/2.24.4/include/gtk-2.0 -I/usr/local/Cellar/gtk+/2.24.4/lib/gtk-2.0/include -I/usr/local/Cellar/atk/2.0.0/include/atk-1.0 -I/usr/local/Cellar/gdk-pixbuf/2.22.1/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/pango/1.28.4/include/pango-1.0 -I/usr/local/Cellar/glib/2.28.7/include/glib-2.0 -I/usr/local/Cellar/glib/2.28.7/lib/glib-2.0/include -I/usr/local/Cellar/gettext/0.18.1.1/include -I/usr/local/Cellar/glib/2.28.7/include -I/usr/include/libxml2 -I/usr/X11/include/cairo -I/usr/X11/include/pixman-1 -I/usr/X11/include/freetype2 -I/usr/X11/include -I/usr/X11/include/libpng12 -DMACOSX -O2 -Wno-long-long -DEXULT_DATADIR=\"/Library/Application\ Support/Exult/data\" -MT shapelst.o -MD -MP -MF .deps/shapelst.Tpo -c -o shapelst.o shapelst.cc
shapelst.cc: In member function ‘time_t Shape_chooser::export_png(const char*, Image_buffer8&, int, int)’:
shapelst.cc:803: error: ‘Export_png8’ was not declared in this scope
shapelst.cc: In function ‘void Import_png(const char*, Shape_file_info*, unsigned char*, int, int)’:
shapelst.cc:1125: error: ‘Import_png8’ was not declared in this scope
shapelst.cc: In function ‘void Import_png_tiles(const char*, Shape_file_info*, unsigned char*, int, int, bool)’:
shapelst.cc:1193: error: ‘Import_png8’ was not declared in this scope
shapelst.cc: In member function ‘void Shape_chooser::import_all_pngs(char*, int)’:
shapelst.cc:1410: error: ‘Import_png8’ was not declared in this scope
make[2]: *** [shapelst.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Again, I've tried explicitly #including SDL.h and also pngio.h (where Export_png8 is defined) to the shapelst.cc. Are there any libraries or include files that I'm clearly missing that may be causing this?

Has anyone else encountered this compilation error? I suppose I could use Exult Studio on a Windows machine using the binary distro or build it for Linux, but I'd rather build my mod on my Mac, since that's the machine I have when I'm out of the house.

Thanks in advance for any tips on how to build this.

Note: I am a fairly experienced C++ programmer, though I've mostly worked in Python for the past few years. I've tried a number of tricks that have worked in other scenarios, but nothing has seemed to work.

Re: Building Exult on OSX: error compiling shapelst.cc

Posted: Thu Jun 02, 2011 4:31 pm
by Dominus
strange, that you needed to explicitly include SDL.h. This indicates to me that some of your includes or paths weren't complete/correctly since I can compile fine on OS X without changing anything in Exult's source. If I see this correctly you are using homebrew or so to get your stuff working (the /usr/local/cellar/... is my only indication). Maybe there is something wrong in the homebrew setup. I never tried that. I can only say it works nicely for using MacPorts or my own prefix.
As a starting point, to start compiling with my own prefix (/opt/exult.x86_64) I set the following environment:

Code: Select all

export PATH=/opt/exult.x86_64/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
export CPPFLAGS=-I/opt/exult.x86_64/include
export CFLAGS='-I/opt/exult.x86_64/include'
export CXXFLAGS='-I/opt/exult.x86_64/include'
export LDFLAGS='-L/opt/exult.x86_64/lib'
export PKG_CONFIG_PATH="/opt/exult.x86_64/lib/pkgconfig"
You need to adapt this for your prefix (/usr/local/cellar/...).

The error points at libpng. Maybe get that from homebrew as well.

Anyway, problem is on your side :)