Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2008, 04:13 PM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default dbcore.cpp error

I'm trying to compile 1119 under debian linux, but i'm getting this error =(

[CODE]-o ../common/dbcore.o
../common/dbcore.cpp: In static member function
Reply With Quote
  #2  
Old 08-01-2008, 06:11 PM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default

wierd cut and paste error on my part i guess >.>

../common/dbcore.cpp: In static member function ‘static bool DBcore::ReadDBINI(char*, char*, char*, char*, int32&, bool&, bool*)’:
../common/dbcore.cpp:112: error: ‘atoi’ was not declared in this scope
make[1]: *** [../common/dbcore.o] Error 1
make[1]: Leaving directory `/home/equsr/EQemu/source/EQEmu-0.7.0-1119/world'
make: *** [all] Error 2
Reply With Quote
  #3  
Old 08-02-2008, 01:00 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Did you edit your source code before you started to compile? There are multiple changes that you have to make for it to compile. Though, I have never seen that particular error.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 08-02-2008, 03:03 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

I assume you're using GCC 4.3. If so, there's some information about this on the GCC website that I found through this forum using this Google search:
Quote:
C++ language issues
Header dependency cleanup

As detailed here (Header dependency streamlining), many of the standard C++ library include files have been edited to only include the smallest possible number of additional files. As such, many C++ programs that used std::memcpy without including <cstring>, or used std::auto_ptr without including <memory> will no longer compile.

Usually, this error is of the form:

error: 'strcmp' was not declared in this scope

The table below shows some of the missing items, and the header file that will have to be added as an #include for the compile to succeed.
If missing Then include this header
find, for_each, sort <algorithm>
ostream_iterator, istream_iterator <iterator>
auto_ptr <memory>
typeid <typeinfo>
isalnum, toupper <cctype>
INT_MIN, INT_MAX, RAND_MAX <climits>
printf <cstdio>
atoi, free, rand, exit <cstdlib>
EXIT_FAILURE <cstdlib>
strcmp, strdup, strcpy, memcpy <cstring>
In other words, change this in common/dbcore.cpp:
Code:
    1 #include "../common/debug.h"
    2 #include "../common/files.h"
    3 
    4 #ifdef WIN32
    5 #include <winsock2.h>
    6 #endif
    7 
    8 #include <iostream>
    9 using namespace std;
   10 #include <errmsg.h>
   11 #include <mysqld_error.h>
   12 #include <limits.h>
   13 #include "dbcore.h"
   14 #include <string.h>
   15 #include "../common/MiscFunctions.h"
   16 
   17 #ifdef WIN32
   18 	#define snprintf	_snprintf
   19 	#define strncasecmp	_strnicmp
   20 	#define strcasecmp	_stricmp
   21 	#include <process.h>
   22 #else
   23 	#include "unix.h"
   24 	#include <pthread.h>
   25 #endif
   26 
   27 #ifdef _EQDEBUG
   28 	#define DEBUG_MYSQL_QUERIES 0
   29 #else
   30 	#define DEBUG_MYSQL_QUERIES 0
   31 #endif
to something like this:
Code:
#include "../common/debug.h"
#include "../common/files.h"

#ifdef WIN32
#include <winsock2.h>
#endif

#include <iostream>
using namespace std;
#include <errmsg.h>
#include <mysqld_error.h>
#include <limits.h>
#include "dbcore.h"
#include <string.h>
#include "../common/MiscFunctions.h"
#include <cstdlib>

#ifdef WIN32
	#define snprintf	_snprintf
	#define strncasecmp	_strnicmp
	#define strcasecmp	_stricmp
	#include <process.h>
#else
	#include "unix.h"
	#include <pthread.h>
#endif

#ifdef _EQDEBUG
	#define DEBUG_MYSQL_QUERIES 0
#else
	#define DEBUG_MYSQL_QUERIES 0
#endif
Or you could do it the lazy way and just downgrade to 4.2 or 4.1 of GCC. I personally have 4.1 and it compiles fine. Long term, this is probably something that may needed to be added to the source in general.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #5  
Old 08-02-2008, 03:07 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Well, the wiki should be pretty up-to-date for getting everything to compile correctly without having to change anything that isn't in the wiki. I know people have done it as recently as this week and it worked fine. Unless there was some change since then that would cause this, I imagine you missed something in there.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #6  
Old 08-02-2008, 09:33 AM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default

yea acually i'm using gcc 4.2 i'll try this here in a few. Guess i shoulda installed etch instead of lenny >.>
Reply With Quote
  #7  
Old 08-02-2008, 10:23 AM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default

after applying your fix to about a dozen files Oo, now i'm getting this error.

client.h:141: warning: ‘typedef’ was ignored in this declaration
zone.cpp: In member function ‘bool Zone::LoadZoneObjects()’:
zone.cpp:184: warning: missing braces around initializer for ‘uint32 [2]’
make[1]: *** [zone.o] Error 1
make[1]: Leaving directory `/home/jenco/EQemu/source/EQEmu-0.7.0-1119/zone'
make: *** [all] Error 2
Reply With Quote
  #8  
Old 08-02-2008, 11:07 AM
Flare83
Sarnak
 
Join Date: Aug 2008
Location: usa
Posts: 43
Default

i got around that error by passing a fpermissive flag to zone's makefile (i know i should'nt do that to make things compile =( ) but it just looks like eqemu just need to be updated to gcc's new specs is all.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:53 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3