sprenger120 / FastCraft

Unfinished C++ Minecraft Server implementation for 1.3.2
16 stars 4 forks source link

Does not build (Linux 3.4.6-1-ARCH x86_64) #73

Open electronicsRules opened 12 years ago

electronicsRules commented 12 years ago

I used autotools to generate a Makefile since one was not included in the GitHub repository. After installing dependencies, this is the log from make. I suspect that a majority of the errors are caused by wide (Unicode?) characters in the code.

(cd lib; gcc -I. -g -O2 -c ../FastCraft/AcceptThread.cpp ../FastCraft/ChunkMath.cpp ../FastCraft/ChunkProvider.cpp ../FastCraft/Constants.cpp ../FastCraft/EntityCoordinates.cpp ../FastCraft/Entity.cpp ../FastCraft/EntityFlags.cpp ../FastCraft/EntityListEntry.cpp ../FastCraft/EntityLiving.cpp ../FastCraft/EntityPickup.cpp ../FastCraft/EntityPlayer.cpp ../FastCraft/FCRuntimeException.cpp ../FastCraft/InventoryPlayer.cpp ../FastCraft/ItemContainer.cpp ../FastCraft/ItemID.cpp ../FastCraft/ItemInformationProvider.cpp ../FastCraft/ItemSlot.cpp ../FastCraft/main.cpp ../FastCraft/MathHelper.cpp ../FastCraft/MinecraftServer.cpp ../FastCraft/NBTBinaryParser.cpp ../FastCraft/NBTTagBase.cpp ../FastCraft/NBTTagByteArray.cpp ../FastCraft/NBTTagByte.cpp ../FastCraft/NBTTagCompound.cpp ../FastCraft/NBTTagDouble.cpp ../FastCraft/NBTTagFloat.cpp ../FastCraft/NBTTagInt64.cpp ../FastCraft/NBTTagInt.cpp ../FastCraft/NBTTagList.cpp ../FastCraft/NBTTagShort.cpp ../FastCraft/NBTTagString.cpp ../FastCraft/NetworkIn.cpp ../FastCraft/NetworkOut.cpp ../FastCraft/NetworkOutRoot.cpp ../FastCraft/NetworkWriter.cpp ../FastCraft/PackingThread.cpp ../FastCraft/PlayerEventBase.cpp ../FastCraft/PlayerEvents.cpp ../FastCraft/PlayerPool.cpp ../FastCraft/PlayerThread.cpp ../FastCraft/ServerThreadBase.cpp ../FastCraft/World.cpp)
In file included from ../FastCraft/AcceptThread.cpp:15:0:
../FastCraft/AcceptThread.h:61:86: error: ‘>>’ should be ‘> >’ within a nested template argument list
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/AcceptThread.cpp:23:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
../FastCraft/AcceptThread.cpp: In member function ‘virtual void AcceptThread::run()’:
../FastCraft/AcceptThread.cpp:61:51: error: ‘>>’ should be ‘> >’ within a nested template argument list
../FastCraft/AcceptThread.cpp: In member function ‘void AcceptThread::cutOffPort(std::string, std::string&)’:
../FastCraft/AcceptThread.cpp:184:7: error: ‘it’ does not name a type
../FastCraft/AcceptThread.cpp:185:10: error: ‘it’ was not declared in this scope
../FastCraft/AcceptThread.cpp:186:33: error: ‘it’ was not declared in this scope
../FastCraft/AcceptThread.cpp: At global scope:
../FastCraft/AcceptThread.cpp:189:99: error: ‘>>’ should be ‘> >’ within a nested template argument list
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/ChunkProvider.cpp:23:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
../FastCraft/Constants.cpp: In static member function ‘static char Constants::get(std::string)’:
../FastCraft/Constants.cpp:119:7: error: ‘it’ does not name a type
../FastCraft/Constants.cpp:121:6: error: ‘it’ was not declared in this scope
../FastCraft/Constants.cpp:125:9: error: ‘it’ was not declared in this scope
../FastCraft/Constants.cpp: In static member function ‘static bool Constants::isDefined(char, std::string)’:
../FastCraft/Constants.cpp:134:8: error: ‘it’ does not name a type
../FastCraft/Constants.cpp:137:10: error: ‘it’ was not declared in this scope
../FastCraft/Constants.cpp:142:11: error: ‘it’ does not name a type
../FastCraft/Constants.cpp:142:29: error: expected ‘;’ before ‘it’
../FastCraft/Constants.cpp:142:29: error: ‘it’ was not declared in this scope
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/EntityPlayer.cpp:23:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
In file included from ../FastCraft/InventoryPlayer.cpp:15:0:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/ItemContainer.cpp:21:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
In file included from ../FastCraft/MinecraftServer.cpp:29:0:
../FastCraft/AcceptThread.h:61:86: error: ‘>>’ should be ‘> >’ within a nested template argument list
../FastCraft/MinecraftServer.cpp: In member function ‘char MinecraftServer::readConfiguration(Poco::Path&)’:
../FastCraft/MinecraftServer.cpp:184:37: error: no matching function for call to ‘std::basic_ifstream<char>::basic_ifstream(std::string)’
../FastCraft/MinecraftServer.cpp:184:37: note: candidates are:
In file included from ../FastCraft/MinecraftServer.cpp:18:0:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/fstream:460:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::_Ios_Openmode]
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/fstream:460:7: note:   no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const char*’
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/fstream:446:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/fstream:446:7: note:   candidate expects 0 arguments, 1 provided
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/fstream:420:11: note: std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/fstream:420:11: note:   no known conversion for argument 1 from ‘std::string {aka std::basic_string<char>}’ to ‘const std::basic_ifstream<char>&’
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/NetworkWriter.cpp:16:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/PackingThread.cpp:20:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/PlayerEvents.cpp:19:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/PlayerPool.cpp:17:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/PlayerThread.cpp:16:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
../FastCraft/PlayerThread.cpp: In member function ‘void PlayerThread::Packet15_PlayerBlockPlacement()’:
../FastCraft/PlayerThread.cpp:1076:45: error: no matching function for call to ‘PlayerThread::spawnBlock(BlockCoordinates&, ItemID)’
../FastCraft/PlayerThread.cpp:1076:45: note: candidate is:
In file included from ../FastCraft/PlayerThread.cpp:16:0:
../FastCraft/PlayerThread.h:317:7: note: void PlayerThread::spawnBlock(BlockCoordinates&, ItemID&)
../FastCraft/PlayerThread.h:317:7: note:   no known conversion for argument 2 from ‘ItemID’ to ‘ItemID&’
../FastCraft/PlayerThread.cpp:1139:58: error: no matching function for call to ‘World::setBlock(BlockCoordinates&, ItemID)’
../FastCraft/PlayerThread.cpp:1139:58: note: candidates are:
In file included from ../FastCraft/PlayerThread.cpp:19:0:
../FastCraft/World.h:133:7: note: void World::setBlock(int, short int, int, ItemID&)
../FastCraft/World.h:133:7: note:   candidate expects 4 arguments, 2 provided
../FastCraft/World.h:134:7: note: void World::setBlock(BlockCoordinates&, ItemID&)
../FastCraft/World.h:134:7: note:   no known conversion for argument 2 from ‘ItemID’ to ‘ItemID&’
../FastCraft/PlayerThread.cpp:1156:44: error: no matching function for call to ‘PlayerThread::spawnBlock(BlockCoordinates&, ItemID)’
../FastCraft/PlayerThread.cpp:1156:44: note: candidate is:
In file included from ../FastCraft/PlayerThread.cpp:16:0:
../FastCraft/PlayerThread.h:317:7: note: void PlayerThread::spawnBlock(BlockCoordinates&, ItemID&)
../FastCraft/PlayerThread.h:317:7: note:   no known conversion for argument 2 from ‘ItemID’ to ‘ItemID&’
../FastCraft/PlayerThread.cpp:1192:43: error: no matching function for call to ‘PlayerThread::spawnBlock(BlockCoordinates&, ItemID)’
../FastCraft/PlayerThread.cpp:1192:43: note: candidate is:
In file included from ../FastCraft/PlayerThread.cpp:16:0:
../FastCraft/PlayerThread.h:317:7: note: void PlayerThread::spawnBlock(BlockCoordinates&, ItemID&)
../FastCraft/PlayerThread.h:317:7: note:   no known conversion for argument 2 from ‘ItemID’ to ‘ItemID&’
../FastCraft/PlayerThread.cpp:1213:45: error: no matching function for call to ‘PlayerThread::spawnBlock(BlockCoordinates&, ItemID)’
../FastCraft/PlayerThread.cpp:1213:45: note: candidate is:
In file included from ../FastCraft/PlayerThread.cpp:16:0:
../FastCraft/PlayerThread.h:317:7: note: void PlayerThread::spawnBlock(BlockCoordinates&, ItemID&)
../FastCraft/PlayerThread.h:317:7: note:   no known conversion for argument 2 from ‘ItemID’ to ‘ItemID&’
../FastCraft/PlayerThread.cpp:1230:44: error: no matching function for call to ‘PlayerThread::spawnBlock(BlockCoordinates&, ItemID)’
../FastCraft/PlayerThread.cpp:1230:44: note: candidate is:
In file included from ../FastCraft/PlayerThread.cpp:16:0:
../FastCraft/PlayerThread.h:317:7: note: void PlayerThread::spawnBlock(BlockCoordinates&, ItemID&)
../FastCraft/PlayerThread.h:317:7: note:   no known conversion for argument 2 from ‘ItemID’ to ‘ItemID&’
../FastCraft/PlayerThread.cpp: In member function ‘void PlayerThread::cleanupSpawnedPlayers()’:
../FastCraft/PlayerThread.cpp:1411:7: error: ‘it’ does not name a type
../FastCraft/PlayerThread.cpp:1414:10: error: ‘it’ was not declared in this scope
In file included from ../FastCraft/PlayerThread.h:35:0,
                 from ../FastCraft/World.cpp:29:
../FastCraft/InventoryPlayer.h:91:7: error: extra qualification ‘InventoryPlayer::’ on member ‘isAllowedToPlace’ [-fpermissive]
../FastCraft/World.cpp: In member function ‘bool World::isSuffocating(PlayerThread*)’:
../FastCraft/World.cpp:158:59: error: no matching function for call to ‘World::isSuffocating(EntityCoordinates, float)’
../FastCraft/World.cpp:158:59: note: candidates are:
../FastCraft/World.cpp:151:6: note: bool World::isSuffocating(Entity*)
../FastCraft/World.cpp:151:6: note:   candidate expects 1 argument, 2 provided
../FastCraft/World.cpp:156:6: note: bool World::isSuffocating(PlayerThread*)
../FastCraft/World.cpp:156:6: note:   candidate expects 1 argument, 2 provided
In file included from ../FastCraft/World.cpp:15:0:
../FastCraft/World.h:118:7: note: bool World::isSuffocating(EntityCoordinates&, float)
../FastCraft/World.h:118:7: note:   no known conversion for argument 1 from ‘EntityCoordinates’ to ‘EntityCoordinates&’
../FastCraft/World.cpp: In member function ‘void World::setBlock(int, short int, int, ItemID&)’:
../FastCraft/World.cpp:199:8: error: ‘Coords’ does not name a type
../FastCraft/World.cpp:200:22: error: ‘Coords’ was not declared in this scope
../FastCraft/World.cpp: In member function ‘ItemID World::getBlock(int, short int, int)’:
../FastCraft/World.cpp:230:8: error: ‘Coords’ does not name a type
../FastCraft/World.cpp:231:34: error: ‘Coords’ was not declared in this scope
../FastCraft/World.cpp: In member function ‘void World::setBlockLight(int, short int, int, char)’:
../FastCraft/World.cpp:325:8: error: ‘coord’ does not name a type
../FastCraft/World.cpp:326:7: error: ‘coord’ was not declared in this scope
../FastCraft/World.cpp:335:44: error: ‘coord’ was not declared in this scope
make: *** [lib/AcceptThread.o] Error 1
sprenger120 commented 12 years ago

Hi, can you post your makefile here?

(I'll release a build script soon, so that you don't have this trouble)

//Edit: I haven't pushed all changes yet. FC will be compileable again in a few days

electronicsRules commented 12 years ago

It's a hacked-together Makefile.in from a template

SHELL = /bin/sh
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@

.SUFFIXES:
.SUFFIXES: .c .o

OPT=-g -O

AR = ar
AR_FLAGS = rc
RANLIB = @RANLIB@

CC = @CC@
CFLAGS = -I. @CFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
INSTALL = @INSTALL@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(exec_prefix)/bin
libdir = $(prefix)/lib
infodir = $(prefix)/info

# ??? replace these with your own list of files
SOURCES=AcceptThread.cpp ChunkMath.cpp ChunkProvider.cpp Constants.cpp EntityCoordinates.cpp Entity.cpp EntityFlags.cpp EntityListEntry.cpp EntityLiving.cpp EntityPickup.cpp EntityPlayer.cpp FCRuntimeException.cpp InventoryPlayer.cpp ItemContainer.cpp ItemID.cpp ItemInformationProvider.cpp ItemSlot.cpp main.cpp MathHelper.cpp MinecraftServer.cpp NBTBinaryParser.cpp NBTTagBase.cpp NBTTagByteArray.cpp NBTTagByte.cpp NBTTagCompound.cpp NBTTagDouble.cpp NBTTagFloat.cpp NBTTagInt64.cpp NBTTagInt.cpp NBTTagList.cpp NBTTagShort.cpp NBTTagString.cpp NetworkIn.cpp NetworkOut.cpp NetworkOutRoot.cpp NetworkWriter.cpp PackingThread.cpp PlayerEventBase.cpp PlayerEvents.cpp PlayerPool.cpp PlayerThread.cpp ServerThreadBase.cpp World.cpp
#DOCS=PROG.texi PROG.info
MISC=configure mkinstalldirs install-sh aclocal.m4
OBJS=$(SOURCES:.cpp=.o)
#LIB_OBJS=libf1.o libf2.o ...

all: FastCraft

FastCraft: lib/$(OBJS)
    $(CC) $(CFLAGS) -o fc $(OBJS) $(LIBS)

lib/$(OBJS): $(addprefix FastCraft/,$(SOURCES))
    (cd lib; $(CC) $(CFLAGS) -c $(addprefix ../FastCraft/,$(SOURCES)))

clean:
    /bin/rm -f core *.o $(OBJS) $(LIB_OBJS) libMYPROG.a

distclean: clean
    /bin/rm -f Makefile config.h config.status config.cache config.log \
        marklib.dvi

mostlyclean: clean

maintainer-clean: clean

# automatic re-running of configure if the configure.in file has changed
${srcdir}/configure: configure.in aclocal.m4
    cd ${srcdir} && autoconf

# autoheader might not change config.h.in, so touch a stamp file
${srcdir}/config.h.in: stamp-h.in
${srcdir}/stamp-h.in: configure.in aclocal.m4
        cd ${srcdir} && autoheader
        echo timestamp > ${srcdir}/stamp-h.in

config.h: stamp-h
stamp-h: config.h.in config.status
    ./config.status
Makefile: Makefile.in config.status
    ./config.status
config.status: configure
    ./config.status --recheck