I have gotten this to compile on Linux, although it needed a few source changes to do so. I unfortunately can't get regular dwarf fortress to run on my machine, so I can't test that it is loading the maps correctly, but the stone sense program starts properly.
The main things you have to change are capitalization issues in some of the dfhack header files you changed, as well as some include directives. In addition I had to install the allegro libraries before compiling, they are available at
http://alleg.sourceforge.net/get the stonesense source with svn checkout
http://stonesense.googlecode.com/svn/trunk/ stonesense
then do the following steps
the incorrect filenames are
in dfhack/libraries
dfcommon.h dftypes.h dftiletypes.h should be DFCommon.h DFTypes.h DFTileTypes.h
and in the base directory
Ramps.bmp should be ramps.bmp
at the top of DFTypes.h and DFCommon.h
in dfhack/libraries/machtypes.h
put #include <sys/types.h> at the top
put #ifdef WINDOWS and #endif directives around the lines
typedef signed __int64 int64_t;
typedef unsigned __int64 u_int64_t;
__extension__ typedef long long int __loff_t;
then build dfhack with cmake as per the dfhack instructions, goto the dfhack/output directory and move the libdfhack.so file into your system lib directory
Next you use sprintf_s and fopen_s in GUI.cpp and xmlBuildingReader.cpp, these are VC++ only functions, but you can change them to the portable sprintf and fopen.
In GUI.cpp
change sprintf_s(filename, "screenshot%i.bmp", index);
to sprintf(filename, "screenshot%i.bmp", index);
and fopen_s(&fp, filename, "r"); to fopen(filename, "r");
and in xmlBuildingReader.cpp
sprintf_s(filepath, "buildings/%s", line.c_str() ); to sprintf(filepath, "buildings/%s", line.c_str() );
after that create a Makefile, here is mine
##----------------------------------------------------------------------------
# Created with genmake.pl v1.1 on Thu Oct 22 12:31:56 2009
# genmake.pl home:
http://muquit.com/muquit/software/# Copryright: GNU GPL (
http://www.gnu.org/copyleft/gpl.html)
##----------------------------------------------------------------------------
rm=/bin/rm -f
CC= gcc
DEFS=
PROGNAME= StoneSense
INCLUDES=-I. -I/IncludeDirectories
LIBS=-L/pathToLibraries -Wl,--export-dynamic -lalleg-4.2.3 -lalleg_unsharable -ldfhack
DEFINES= $(INCLUDES) $(DEFS) -DSYS_UNIX=1
CFLAGS= -g $(DEFINES)
SRCS = BlockCondition.cpp Block.cpp BuildingConfiguration.cpp ConditionalSprite.cpp Config.cpp Constructions.cpp GameBuildings.cpp GUI.cpp main.cpp MapLoading.cpp SpriteMaps.cpp UserInput.cpp WorldSegment.cpp xmlBuildingReader.cpp
OBJS = BlockCondition.o Block.o BuildingConfiguration.o ConditionalSprite.o Config.o Constructions.o GameBuildings.o GUI.o main.o MapLoading.o SpriteMaps.o UserInput.o WorldSegment.o xmlBuildingReader.o
.cpp.o:
$(rm) $@
$(CC) $(CFLAGS) -c $*.cpp
all: $(PROGNAME)
$(PROGNAME) : $(OBJS)
$(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)
clean:
$(rm) $(OBJS) $(PROGNAME) core *~
You have to change the library and include paths into the proper places for your distribution in the above makefile
then type make and it should compile!