Compile Errors - CentOS 5.3 x86_64 Rev 370

Support forum for questions about compiling and running EQ2Emulator on Linux.

Moderator: Team Members

Post Reply
DreamDemon
Posts: 3
Joined: Tue Jan 05, 2010 7:56 am

Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by DreamDemon » Tue Jan 05, 2010 8:04 am

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

DreamDemon
Posts: 3
Joined: Tue Jan 05, 2010 7:56 am

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by DreamDemon » Tue Jan 05, 2010 4:42 pm

Thank for the help on IRC. Now when compiling it doesnt like the libmysql files claiming they are incompatible.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by LethalEncounter » Tue Jan 05, 2010 5:29 pm

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?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by John Adams » Wed Jan 06, 2010 12:26 am

Linux 64bit has not been compiling for me either, so my Dev server is x86 on Linux.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by LethalEncounter » Wed Jan 06, 2010 5:44 pm

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.

DreamDemon
Posts: 3
Joined: Tue Jan 05, 2010 7:56 am

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by DreamDemon » Fri Jan 08, 2010 4:56 pm

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)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by John Adams » Fri Jan 08, 2010 4:57 pm

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.

User avatar
jasonmicron
Posts: 19
Joined: Tue May 24, 2011 11:44 am
EQ2Emu Server: micronville
Characters: jasonmicron, katal, bhex

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by jasonmicron » Tue May 24, 2011 11:49 am

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...

User avatar
jasonmicron
Posts: 19
Joined: Tue May 24, 2011 11:44 am
EQ2Emu Server: micronville
Characters: jasonmicron, katal, bhex

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by jasonmicron » Tue May 24, 2011 11:55 am

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.

User avatar
jasonmicron
Posts: 19
Joined: Tue May 24, 2011 11:44 am
EQ2Emu Server: micronville
Characters: jasonmicron, katal, bhex

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by jasonmicron » Tue May 24, 2011 12:12 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by John Adams » Tue May 24, 2011 1:38 pm

If you want to post your fixed Makefile, I can add it to SVN for the specific flavor of Linux (makefile.fedora or whatever)

User avatar
jasonmicron
Posts: 19
Joined: Tue May 24, 2011 11:44 am
EQ2Emu Server: micronville
Characters: jasonmicron, katal, bhex

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by jasonmicron » Tue May 24, 2011 2:02 pm

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*

User avatar
jasonmicron
Posts: 19
Joined: Tue May 24, 2011 11:44 am
EQ2Emu Server: micronville
Characters: jasonmicron, katal, bhex

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by jasonmicron » Tue May 24, 2011 8:23 pm

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.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by Zcoretri » Wed May 25, 2011 9:19 am

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:

User avatar
jasonmicron
Posts: 19
Joined: Tue May 24, 2011 11:44 am
EQ2Emu Server: micronville
Characters: jasonmicron, katal, bhex

Re: Compile Errors - CentOS 5.3 x86_64 Rev 370

Post by jasonmicron » Wed May 25, 2011 9:54 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests