Author Topic: [SOLVED] Error compiling on Raspberry Pi  (Read 838 times)

ChilloManiac

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
[SOLVED] Error compiling on Raspberry Pi
« on: June 03, 2015, 05:04:15 pm »
Hi im right now sitting with a spare Raspberry Pi, and wanted for fun to see if i could get a GHost++ bot running on it. Just for kicks. Following the stickied post here but when making in /usr/src/ghost/ghost i get some error that i can't for the life of me solve. any help appreciated

Code: [Select]
pi@raspberrypi /usr/src/ghost/ghost $ sudo make
g++ -o ghostdbmysql.o  -O3 -DGHOST_MYSQL -I. -I../bncsutil/src/ -I../StormLib/ -c ghostdbmysql.cpp
In file included from /usr/include/boost/thread/pthread/mutex.hpp:14:0,
                 from /usr/include/boost/thread/mutex.hpp:16,
                 from /usr/include/boost/thread/pthread/thread_data.hpp:12,
                 from /usr/include/boost/thread/thread.hpp:17,
                 from /usr/include/boost/thread.hpp:13,
                 from ghostdbmysql.cpp:36:
/usr/include/boost/thread/xtime.hpp:23:5: error: expected identifier before numeric constant
/usr/include/boost/thread/xtime.hpp:23:5: error: expected ‘}’ before numeric constant
/usr/include/boost/thread/xtime.hpp:23:5: error: expected unqualified-id before numeric constant
/usr/include/boost/thread/xtime.hpp:46:14: error: expected type-specifier before ‘system_time’
In file included from /usr/include/boost/thread/pthread/mutex.hpp:14:0,
                 from /usr/include/boost/thread/mutex.hpp:16,
                 from /usr/include/boost/thread/pthread/thread_data.hpp:12,
                 from /usr/include/boost/thread/thread.hpp:17,
                 from /usr/include/boost/thread.hpp:13,
                 from ghostdbmysql.cpp:36:
/usr/include/boost/thread/xtime.hpp: In function ‘int xtime_get(xtime*, int)’:
/usr/include/boost/thread/xtime.hpp:73:40: error: ‘get_system_time’ was not declared in this scope
/usr/include/boost/thread/xtime.hpp:73:40: note: suggested alternative:
/usr/include/boost/thread/thread_time.hpp:19:24: note:   ‘boost::get_system_time’
/usr/include/boost/thread/xtime.hpp: At global scope:
/usr/include/boost/thread/xtime.hpp:88:1: error: expected declaration before ‘}’ token
Makefile:45: recipe for target 'ghostdbmysql.o' failed
make: *** [ghostdbmysql.o] Error 1

libboost version:

Code: [Select]
pi@raspberrypi /usr/src/ghost/ghost $ ls /usr/lib | grep boost
libboost_date_time.a
libboost_date_time-mt.a
libboost_date_time-mt.so
libboost_date_time.so
libboost_date_time.so.1.49.0
libboost_filesystem.a
libboost_filesystem-mt.a
libboost_filesystem-mt.so
libboost_filesystem.so
libboost_filesystem.so.1.49.0
libboost_iostreams.so.1.46.1
libboost_iostreams.so.1.48.0
libboost_iostreams.so.1.49.0
libboost_iostreams.so.1.50.0
libboost_serialization.a
libboost_serialization-mt.a
libboost_serialization-mt.so
libboost_serialization.so
libboost_serialization.so.1.49.0
libboost_system.a
libboost_system-mt.a
libboost_system-mt.so
libboost_system.so
libboost_system.so.1.49.0
libboost_thread.a
libboost_thread-mt.a
libboost_thread-mt.so
libboost_thread.so
libboost_thread.so.1.49.0
libboost_wserialization.a
libboost_wserialization-mt.a
libboost_wserialization-mt.so
libboost_wserialization.so
libboost_wserialization.so.1.49.0

and the makefile
Code: [Select]
SHELL = /bin/sh
SYSTEM = $(shell uname)
C++ = g++
CC = gcc
DFLAGS = -DGHOST_MYSQL
OFLAGS = -O3
LFLAGS = -L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -lbncsutil -lpthread -ldl -lz -lStorm -lmysqlclient_r -lboost_date_time -lboost_thread -lboost_system -lboost_filesystem -lgmp
CFLAGS =

ifeq ($(SYSTEM),Darwin)
DFLAGS += -D__APPLE__
OFLAGS += -flat_namespace
else
LFLAGS += -lrt
endif

ifeq ($(SYSTEM),FreeBSD)
DFLAGS += -D__FREEBSD__
endif

ifeq ($(SYSTEM),SunOS)
DFLAGS += -D__SOLARIS__
LFLAGS += -lresolv -lsocket -lnsl
endif

CFLAGS += $(OFLAGS) $(DFLAGS) -I. -I../bncsutil/src/ -I../StormLib/

ifeq ($(SYSTEM),Darwin)
CFLAGS += -I../mysql/include/
endif

OBJS = bncsutilinterface.o bnet.o bnetprotocol.o bnlsclient.o bnlsprotocol.o commandpacket.o config.o crc32.o csvparser.o game.o game_admin.o game_base.o gameplayer.o gameprotocol.o gameslot.o ghost.o ghostdb.o ghostdbmysql.o ghostdbsql$
COBJS = sqlite3.o
PROGS = ./ghost++

all: $(OBJS) $(COBJS) $(PROGS)

./ghost++: $(OBJS) $(COBJS)
        $(C++) -o ./ghost++ $(OBJS) $(COBJS) $(LFLAGS)

clean:
        rm -f $(OBJS) $(COBJS) $(PROGS)

$(OBJS): %.o: %.cpp
        $(C++) -o $@ $(CFLAGS) -c $<

$(COBJS): %.o: %.c
        $(CC) -o $@ $(CFLAGS) -c $<

./ghost++: $(OBJS) $(COBJS)

all: $(PROGS)

bncsutilinterface.o: ghost.h includes.h util.h bncsutilinterface.h
bnet.o: ghost.h includes.h util.h config.h language.h socket.h commandpacket.h ghostdb.h bncsutilinterface.h bnlsclient.h bnetprotocol.h bnet.h map.h packed.h savegame.h replay.h gameprotocol.h game_base.h
bnetprotocol.o: ghost.h includes.h util.h bnetprotocol.h
bnlsclient.o: ghost.h includes.h util.h socket.h commandpacket.h bnlsprotocol.h bnlsclient.h
bnlsprotocol.o: ghost.h includes.h util.h bnlsprotocol.h
commandpacket.o: ghost.h includes.h commandpacket.h
config.o: ghost.h includes.h config.h
crc32.o: ghost.h includes.h crc32.h
csvparser.o: csvparser.h
game.o: ghost.h includes.h util.h config.h language.h socket.h ghostdb.h bnet.h map.h packed.h savegame.h gameplayer.h gameprotocol.h game_base.h game.h stats.h statsdota.h statsw3mmd.h
game_admin.o: ghost.h includes.h util.h config.h language.h socket.h ghostdb.h bnet.h map.h packed.h savegame.h replay.h gameplayer.h gameprotocol.h game_base.h game_admin.h
game_base.o: ghost.h includes.h util.h config.h language.h socket.h ghostdb.h bnet.h map.h packed.h savegame.h replay.h gameplayer.h gameprotocol.h game_base.h next_combination.h
gameplayer.o: ghost.h includes.h util.h language.h socket.h commandpacket.h bnet.h map.h gameplayer.h gameprotocol.h gpsprotocol.h game_base.h
gameprotocol.o: ghost.h includes.h util.h crc32.h gameplayer.h gameprotocol.h game_base.h
gameslot.o: ghost.h includes.h gameslot.h
ghost.o: ghost.h includes.h util.h crc32.h sha1.h csvparser.h config.h language.h socket.h ghostdb.h ghostdbsqlite.h ghostdbmysql.h bnet.h map.h packed.h savegame.h gameplayer.h gameprotocol.h gpsprotocol.h game_base.h game.h game_admin$
ghostdb.o: ghost.h includes.h util.h config.h ghostdb.h
ghostdbmysql.o: ghost.h includes.h util.h config.h ghostdb.h ghostdbmysql.h
ghostdbsqlite.o: ghost.h includes.h util.h config.h ghostdb.h ghostdbsqlite.h
gpsprotocol.o: ghost.h util.h gpsprotocol.h
language.o: ghost.h includes.h config.h language.h
map.o: ghost.h includes.h util.h crc32.h sha1.h config.h map.h
packed.o: ghost.h includes.h util.h crc32.h packed.h
replay.o: ghost.h includes.h util.h packed.h replay.h gameprotocol.h
savegame.o: ghost.h includes.h util.h packed.h savegame.h
sha1.o: sha1.h
socket.o: ghost.h includes.h util.h socket.h
stats.o: ghost.h includes.h stats.h
statsdota.o: ghost.h includes.h util.h ghostdb.h gameplayer.h gameprotocol.h game_base.h stats.h statsdota.h
statsw3mmd.o: ghost.h includes.h util.h ghostdb.h gameprotocol.h game_base.h stats.h statsw3mmd.h
util.o: ghost.h includes.h util.h
« Last Edit: June 10, 2015, 02:36:19 pm by ChilloManiac »

ChilloManiac

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Error compiling on Raspberry Pi
« Reply #1 on: June 10, 2015, 02:32:49 pm »
Found the solution

Rename all instances in /usr/include/boost/thread/xtime.hpp from TIME_UTC to TIME_UTC_

Dunno why it works, but it did