Page 1 of 1

Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue Jan 05, 2010 8:04 am
by DreamDemon
I'm running into compile errors and have all the required deps installed. I did change the CPU type since it didn't like the i686 option on my server. It's also not picking up my mysql.h even tho the source is installed.

svn co https://eq2emulator.svn.sourceforge.net ... q2emulator gives me rev 370

Any ideas?

Code: Select all

[dsr@wolverine World]$ make
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include ../common/timer.cpp -o ../common/timer.o
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include ../common/packet_dump.cpp -o ../common/packet_dump.o
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include races.cpp -o races.o
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include ../common/unix.cpp -o ../common/unix.o
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include ../common/Mutex.cpp -o ../common/Mutex.o
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include ../common/MiscFunctions.cpp -o ../common/MiscFunctions.o
../common/MiscFunctions.cpp: In function âstd::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >* SplitString(std::string, char)â:
../common/MiscFunctions.cpp:394: warning: comparison is always true due to limited range of data type
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include ../common/emu_opcodes.cpp -o ../common/emu_opcodes.o
g++ -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=opteron -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include Commands.cpp -o Commands.o
In file included from Commands.cpp:24:
WorldDatabase.h:27:19: error: mysql.h: No such file or directory
../common/dbcore.h:53: error: âMYSQL_RESâ has not been declared
../common/dbcore.h:66: error: âMYSQLâ does not name a type
../common/database.h:91: error: ISO C++ forbids declaration of âMYSQL_RESâ with no type
../common/database.h:91: error: expected â;â before â*â token
../common/database.h:92: error: expected `;' before âMYSQL_RESâ
../common/database.h:92: error: ISO C++ forbids declaration of âMYSQL_RESâ with no type
../common/database.h:92: error: expected â;â before â*â token
../common/database.h:108: error: ISO C++ forbids declaration of âMYSQL_RESâ with no type
../common/database.h:108: error: expected â;â before â*â token
../common/database.h:114: error: âMYSQL_ERRMSG_SIZEâ was not declared in this scope
../common/database.h:115: error: ISO C++ forbids declaration of âMYSQL_RESâ with no type
../common/database.h:115: error: expected â;â before â*â token
../common/database.h:116: error: âMYSQL_RESâ was not declared in this scope
../common/database.h:116: error: template argument 1 is invalid
../common/database.h:116: error: template argument 2 is invalid
../common/database.h:121: error: ISO C++ forbids declaration of âMYSQL_ROWâ with no type
../common/database.h:121: error: expected â;â before â*â token
../common/database.h:122: error: âMYSQLâ does not name a type
../common/database.h: In constructor âQuery::Query()â:
../common/database.h:61: error: âresultâ was not declared in this scope
../common/database.h:65: error: ârowâ was not declared in this scope
../common/database.h: In destructor âQuery::~Query()â:
../common/database.h:73: error: âresultâ was not declared in this scope
../common/database.h:74: error: âmysql_free_resultâ was not declared in this scope
../common/database.h:75: error: âresultâ was not declared in this scope
../common/database.h:82: error: âMYSQL_RESâ was not declared in this scope
../common/database.h:82: error: template argument 1 is invalid
../common/database.h:82: error: template argument 2 is invalid
../common/database.h:82: error: expected initializer before âitrâ
../common/database.h:83: error: âitrâ was not declared in this scope
../common/database.h:83: error: request for member âbeginâ in â*((Query*)this)->Query::multiple_resultsâ, which is of non-class type âintâ
../common/database.h:83: error: request for member âendâ in â*((Query*)this)->Query::multiple_resultsâ, which is of non-class type âintâ
../common/database.h:84: error: âmysql_free_resultâ was not declared in this scope
../common/database.h: In member function âchar* Query::GetError()â:
../common/database.h:93: error: âerrbufâ was not declared in this scope
../common/database.h: In member function âchar* Query::GetField(int8)â:
../common/database.h:97: error: ârowâ was not declared in this scope
../common/database.h:97: error: âresultâ was not declared in this scope
../common/database.h:98: error: âmysql_fetch_rowâ was not declared in this scope
../common/database.h:99: error: ârowâ was not declared in this scope
../common/database.h:99: error: âresultâ was not declared in this scope
../common/database.h:99: error: âmysql_num_fieldsâ was not declared in this scope
../common/database.h: In member function âvoid Query::NextRow()â:
../common/database.h:105: error: âresultâ was not declared in this scope
../common/database.h:106: error: ârowâ was not declared in this scope
../common/database.h:106: error: âmysql_fetch_rowâ was not declared in this scope
WorldDatabase.h: At global scope:
WorldDatabase.h:237: error: âMYSQL_ROWâ has not been declared
make: *** [Commands.o] Error 1

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue Jan 05, 2010 4:42 pm
by DreamDemon
Thank for the help on IRC. Now when compiling it doesnt like the libmysql files claiming they are incompatible.

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue Jan 05, 2010 5:29 pm
by LethalEncounter
Sounds like you have a mysql library issue. Make sure that your LD_LIBRARY_PATH contains a copy of the library. You might have to manually edit the make file to point it to your location as since we don't use a configuration script (although we should), the included Makefile will not work for some setups. What version of mysql are you using?

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Wed Jan 06, 2010 12:26 am
by John Adams
Linux 64bit has not been compiling for me either, so my Dev server is x86 on Linux.

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Wed Jan 06, 2010 5:44 pm
by LethalEncounter
Does it fail when linking or compiling John? If linking, do you have the 64 bit libraries for mysql and zlib? That could be it.

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Fri Jan 08, 2010 4:56 pm
by DreamDemon
I got it to compile under Ubuntu server x64! The problem was in the linking. The wiki states to remove the 5.1 ( from -llua5.1 to -llua) which breaks it. If you leave it alone, it should compile.

On to the next stage of the setup! 8)

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Fri Jan 08, 2010 4:57 pm
by John Adams
Pretty sure mine was compile, failed almost immediately, something about unsupported processor type I think. Been a while, I can try it again sometime and let you know.

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue May 24, 2011 11:49 am
by jasonmicron
John Adams wrote:Pretty sure mine was compile, failed almost immediately, something about unsupported processor type I think. Been a while, I can try it again sometime and let you know.
I had that problem too. I changed -march=i686 to -march=generic in the makefile and it started compiling.

I'm having issues with this though:

Code: Select all

gcc -Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align -Wno-deprecated -g -march=native -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEXY -DEQ2 -DWORLD -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include  ../common/timer.o ../common/packet_dump.o races.o ../common/unix.o ../common/Mutex.o ../common/MiscFunctions.o ../common/emu_opcodes.o Commands.o Items.o classes.o ../common/TCPConnection.o Combat.o client.o net.o LoginServer.o ../common/md5.o ../common/dbcore.o Skills.o GroundSpawn.o ../common/EQEMuError.o ../common/misc.o ../common/Crypto.o ../common/RC4.o .obj/debug.o .obj/database.o .obj/EQStream.o ../common/xmlParser.o WorldDatabase.o NPC.o Player.o .obj/EQStreamFactory.o .obj/EQPacket.o ../common/CRC16.o ../common/packet_functions.o ../common/Condition.o ../common/opcodemgr.o zoneserver.o Spawn.o Object.o ../common/ConfigReader.o ../common/PacketStruct.o World.o ClientPacketFunctions.o SpellProcess.o Spells.o LuaFunctions.o LuaInterface.o NPC_AI.o Entity.o Widget.o Sign.o Quests.o Factions.o Guild.o -rdynamic -L. -lstdc++ -lm -lz -L/usr/lib/mysql -L/usr/mysql/lib -lmysqlclient -llua -ldl -o eq2world
/usr/bin/ld: cannot find -lmysqlclient
I have the correct libs installed for mysql 5 (libraries are in /usr/lib64/mysql and are .15). I'll keep banging away on it...

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue May 24, 2011 11:55 am
by jasonmicron
I guess it helps if the packages on the atomic repository were signed. yum never installed them which is why mysqlclient isn't in my $PATH.

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue May 24, 2011 12:12 pm
by jasonmicron
Ahh, problem hopefully solved. In the makefile, /usr/lib/mysql was specified on the LINKOPTS line. However, these libraries are stored in /usr/lib64/mysql. Changing this fixed it and it compiled.

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue May 24, 2011 1:38 pm
by John Adams
If you want to post your fixed Makefile, I can add it to SVN for the specific flavor of Linux (makefile.fedora or whatever)

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue May 24, 2011 2:02 pm
by jasonmicron
sure, i'll post it when i get home. for some reason my server at the house stopped responding, no ssh or even http access so i can't post it right now. guess i had a power hit *shrug*

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Tue May 24, 2011 8:23 pm
by jasonmicron

Code: Select all

[jasonmicron@mediasrv World]$ cat makefile
APP=eq2world
SF= ../common/timer.o ../common/packet_dump.o races.o ../common/unix.o \
   ../common/Mutex.o ../common/MiscFunctions.o ../common/emu_opcodes.o Commands.                                 o Items.o \
   classes.o ../common/TCPConnection.o Combat.o ../common/emu_opcodes.o \
   client.o net.o LoginServer.o ../common/md5.o ../common/dbcore.o Skills.o Grou                                 ndSpawn.o \
   ../common/EQEMuError.o ../common/misc.o ../common/Crypto.o ../common/RC4.o \
   .obj/debug.o .obj/database.o .obj/EQStream.o ../common/xmlParser.o WorldDatab                                 ase.o NPC.o Player.o \
   .obj/EQStreamFactory.o .obj/EQPacket.o ../common/CRC16.o ../common/packet_fun                                 ctions.o \
   ../common/Condition.o ../common/opcodemgr.o zoneserver.o Spawn.o Object.o ../                                 common/ConfigReader.o \
   ../common/PacketStruct.o World.o ClientPacketFunctions.o SpellProcess.o Spell                                 s.o \
   LuaFunctions.o LuaInterface.o NPC_AI.o Entity.o Widget.o Sign.o Quests.o Fact                                 ions.o Guild.o \

CC=g++
LINKER=gcc
DFLAGS=-DEQ2 -DWORLD
WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align                                  -Wno-deprecated
COPTS=$(WFLAGS) -g -march=native -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEX                                 Y $(DFLAGS) -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include
LINKOPTS=-rdynamic -L. -lstdc++ -lm -lz -L/usr/lib64/mysql -L/usr/mysql/lib -lmy                                 sqlclient -llua -ldl
all: $(APP)

$(APP): $(SF)
        $(LINKER) $(COPTS) $(OBJS) $^ $(LINKOPTS) -o $@

clean:
        rm -f $(SF) $(APP)

%.o: %.cpp
        $(CC) -c $(COPTS) $< -o $@

.obj/%.o: ../common/%.cpp ../common/%.h
        mkdir -p .obj
        $(CC) $(COPTS) -c $< -o $@
This is the makefile that worked for me. uname -a shows:
Linux mediasrv 2.6.35.13-91.fc14.x86_64 #1 SMP Tue May 3 13:23:06 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

The important things here that I had to modify were:
-march=native (was -march=i686)
LINKOPTS=(... -L/usr/lib64/mysql (was -L/usr/lib/mysql) ...)
LINKOPTS=(... -llua (was -llua5.1) ...)

Changing those three options worked my Fedora 14 64-bit.

One other thing that might have helped as well was I had to disable gpg checking in /etc/yum.repos.d/atomic.repo to allow installation of mysqlclient14. This *might* not have changed anything, but I wanted to mention it. Yum would report that it could not verify the key with it enabled and would not download mysqlclient from atomic.

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Wed May 25, 2011 9:19 am
by Zcoretri
jasonmicron wrote:

Code: Select all

[jasonmicron@mediasrv World]$ cat makefile
APP=eq2world
SF= ../common/timer.o ../common/packet_dump.o races.o ../common/unix.o \
   ../common/Mutex.o ../common/MiscFunctions.o ../common/emu_opcodes.o Commands.                                 o Items.o \
   classes.o ../common/TCPConnection.o Combat.o ../common/emu_opcodes.o \
   client.o net.o LoginServer.o ../common/md5.o ../common/dbcore.o Skills.o Grou                                 ndSpawn.o \
   ../common/EQEMuError.o ../common/misc.o ../common/Crypto.o ../common/RC4.o \
   .obj/debug.o .obj/database.o .obj/EQStream.o ../common/xmlParser.o WorldDatab                                 ase.o NPC.o Player.o \
   .obj/EQStreamFactory.o .obj/EQPacket.o ../common/CRC16.o ../common/packet_fun                                 ctions.o \
   ../common/Condition.o ../common/opcodemgr.o zoneserver.o Spawn.o Object.o ../                                 common/ConfigReader.o \
   ../common/PacketStruct.o World.o ClientPacketFunctions.o SpellProcess.o Spell                                 s.o \
   LuaFunctions.o LuaInterface.o NPC_AI.o Entity.o Widget.o Sign.o Quests.o Fact                                 ions.o Guild.o \

CC=g++
LINKER=gcc
DFLAGS=-DEQ2 -DWORLD
WFLAGS=-Wall -Wuninitialized -Wwrite-strings -Wcast-qual  -Wcomment -Wcast-align                                  -Wno-deprecated
COPTS=$(WFLAGS) -g -march=native -O -pthread -pipe -DFX -D_GNU_SOURCE -DINVERSEX                                 Y $(DFLAGS) -I/usr/include/mysql -I/usr/mysql/include -I./LUA/include
LINKOPTS=-rdynamic -L. -lstdc++ -lm -lz -L/usr/lib64/mysql -L/usr/mysql/lib -lmy                                 sqlclient -llua -ldl
all: $(APP)

$(APP): $(SF)
        $(LINKER) $(COPTS) $(OBJS) $^ $(LINKOPTS) -o $@

clean:
        rm -f $(SF) $(APP)

%.o: %.cpp
        $(CC) -c $(COPTS) $< -o $@

.obj/%.o: ../common/%.cpp ../common/%.h
        mkdir -p .obj
        $(CC) $(COPTS) -c $< -o $@
This is the makefile that worked for me. uname -a shows:
Linux mediasrv 2.6.35.13-91.fc14.x86_64 #1 SMP Tue May 3 13:23:06 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

The important things here that I had to modify were:
-march=native (was -march=i686)
LINKOPTS=(... -L/usr/lib64/mysql (was -L/usr/lib/mysql) ...)
LINKOPTS=(... -llua (was -llua5.1) ...)

Changing those three options worked my Fedora 14 64-bit.

One other thing that might have helped as well was I had to disable gpg checking in /etc/yum.repos.d/atomic.repo to allow installation of mysqlclient14. This *might* not have changed anything, but I wanted to mention it. Yum would report that it could not verify the key with it enabled and would not download mysqlclient from atomic.
That was all greek to me...what language you talking, lol :mrgreen:

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Posted: Wed May 25, 2011 9:54 am
by jasonmicron
haha ;)

that was the text from the makefile that was included with the source for the linux server setup. those three modifications were all that i did to get it to compile on my 64-bit Fedora system.