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 09-25-2008, 01:01 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by spider661 View Post
Code:
[root@server1 ~]# cd /home/spider661/eqemu/source/9232008/EMuShareMem
[root@server1 EMuShareMem]# make clean
rm -f MMFMutex.o Doors.o Items.o Spells.o NPCFactionLists.o MMF.o Loot.o Opcodes.o SkillCaps.o DLLMain.o .obj/timer.o .obj/unix.o libEMuShareMem.so
[root@server1 EMuShareMem]# make

...

ccache gcc -c -Wall -Wuninitialized -Wwrite-strings -Wcast-qual -Wcomment -Wcast-align -Wno-deprecated -g -march=i686 -O -pthread -pipe -I../common/SocketLib -DFX -D_GNU_SOURCE -DINVERSEXY -DWORLD -DDEBUG=5 -DEQDEBUG=5 -DSHAREMEM -DCATCH_CRASH -DNO_PIDLOG -DFIELD_ITEMS -DIRC -Di386 -DAPP_OPCODE_SIZE=2 -DEMBPERL -DEMBPERL_PLUGIN -DHAS_UNION_SEMUN -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv  -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm  -I/usr/lib/perl5/5.10.0/i386-linux-thread-multi/CORE  ../common/dbcore.cpp -o ../common/dbcore.o
../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
../common/dbcore.cpp:67: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’, declared with attribute warn_unused_result
make: *** [../common/dbcore.o] Error 1

[root@server1 world]# cd /home/spider661/eqemu/source/9232008/zone
[root@server1 zone]# make clean
rm -f ...
[root@server1 zone]# make

...

../common/EQPacket.cpp: In static member function ‘static void EQProtocolPacket::ChatDecode(unsigned char*, int, int)’:
../common/EQPacket.cpp:394: error: ‘malloc’ was not declared in this scope
../common/EQPacket.cpp:411: error: ‘free’ was not declared in this scope
../common/EQPacket.cpp: In static member function ‘static void EQProtocolPacket::ChatEncode(unsigned char*, int, int)’:
../common/EQPacket.cpp:419: error: ‘malloc’ was not declared in this scope
../common/EQPacket.cpp:435: error: ‘free’ was not declared in this scope
make: *** [.obj/EQPacket.o] Error 1
I know I've come across this before, possibly while I was trying to compile some custom code, but here's your answer to the original problem:
http://gcc.gnu.org/gcc-4.3/porting_to.html
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.
Code:
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>
It's not listed here, but malloc() is also in the <cstdlib> library.

So, in short, just add an #include <cstdlib> at the beginning of common/dbcore.cpp, common/EQPacket.cpp, and any other files that give those kinds of errors and you should be good. Imo, I think it might be a good idea to get this ultimately updated into the source, as well as resolve any other incompatibilities between 4.1 & 4.3.

Hope this helps.
__________________
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
  #2  
Old 09-25-2008, 08:16 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

This is good stuff, thanks for clearing this topic out for me, I've searched, but never got this far.
My newest distro will not let me uninstall the latest GCC, as it says it's used for other compiles and would break too much. I've gotten away with installing multiple versions of GCC or for the user only.
This is much better and should solve a lot.

Quote:
Originally Posted by AndMetal View Post
I know I've come across this before, possibly while I was trying to compile some custom code, but here's your answer to the original problem:
http://gcc.gnu.org/gcc-4.3/porting_to.html

It's not listed here, but malloc() is also in the <cstdlib> library.

So, in short, just add an #include <cstdlib> at the beginning of common/dbcore.cpp, common/EQPacket.cpp, and any other files that give those kinds of errors and you should be good. Imo, I think it might be a good idea to get this ultimately updated into the source, as well as resolve any other incompatibilities between 4.1 & 4.3.

Hope this helps.
Reply With Quote
  #3  
Old 10-13-2008, 07:27 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default Now they clobber me!

I wonder if anyone might know what or why the cause for this. I tried other versions of gcc with the same results, and this only happens on on of my pcs, and even will sometimes go through with the compile.
Quote:
../common/crc32.cpp:106:2: warning: #warning "Comment out i386 define if your arch isn't x86"
../common/crc32.cpp: In static member function ‘static uint32 CRC32::Update(const int8*, uint32, uint32)’:
../common/crc32.cpp:239: error: PIC register ‘bx’ clobbered in ‘asm’
make: *** [../common/crc32.o] Error 1
[angelox@drake world]$

Here's two ways to use other versions of gcc (have to install them first);
Code:
#cd /usr/bin
#unlink gcc
#ln -sf gcc-VERSIONTHATYOUWANT gcc
Or use EXPORT
Code:
export CC=/usr/bin/gcc-3.4
Reply With Quote
  #4  
Old 10-14-2008, 12:52 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

[QUOTE=Angelox;158252]I wonder if anyone might know what or why the cause for this. I tried other versions of gcc with the same results, and this only happens on on of my pcs, and even will sometimes go through with the compile.

[CODE]
../common/crc32.cpp: In static member function
__________________
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 10-14-2008, 06:45 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Quote:
I wonder if anyone might know what or why the cause for this. I tried other versions of gcc with the same results, and this only happens on on of my pcs, and even will sometimes go through with the compile.

[CODE]
../common/crc32.cpp: In static member function
I think you got your reply cut in half - happened to me on this very same thread
Reply With Quote
  #6  
Old 10-14-2008, 01:17 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by Angelox View Post
I think you got your reply cut in half - happened to me on this very same thread
Yeah, lol. Let's try this again...

Quote:
Originally Posted by Angelox View Post
I wonder if anyone might know what or why the cause for this. I tried other versions of gcc with the same results, and this only happens on on of my pcs, and even will sometimes go through with the compile.

Code:
../common/crc32.cpp: In static member function ‘static uint32 CRC32::Update(const int8*, uint32, uint32)’:
../common/crc32.cpp:239: error: PIC register ‘bx’ clobbered in ‘asm’
make: *** [../common/crc32.o] Error 1
Teh intertubes indicates it's an issue specific to GCC 3.4. This is the suspect code:
Code:
__asm __volatile (
		"xorl	%%ebx, %%ebx\n"
		"movl	%1, %%esi\n" 
		"movl	%2, %%ecx\n" 
		"movl	$CRC32Table, %%edi\n"
		"shrl	$2, %%ecx\n"
		"jz	1f\n"

		".align 4\n"
		"0:\n"
		"movb	%%al, %%bl\n"
		"movl	(%%esi), %%edx\n"
		"shrl	$8, %%eax\n"
		"xorb	%%dl, %%bl\n"
		"shrl	$8, %%edx\n"
		"xorl	(%%edi,%%ebx,4), %%eax\n"

		"movb	%%al, %%bl\n"
		"shrl	$8, %%eax\n"
		"xorb	%%dl, %%bl\n"
		"shrl	$8, %%edx\n"
		"xorl	(%%edi,%%ebx,4), %%eax\n"

		"movb	%%al, %%bl\n"
		"shrl	$8, %%eax\n"
		"xorb	%%dl, %%bl\n"
		"movb	%%dh, %%dl\n" 
		"xorl	(%%edi,%%ebx,4), %%eax\n"

		"movb	%%al, %%bl\n"
		"shrl	$8, %%eax\n"
		"xorb	%%dl, %%bl\n"
		"addl	$4, %%esi\n"
		"xorl	(%%edi,%%ebx,4), %%eax\n"

		"decl	%%ecx\n"
		"jnz	0b\n"

		"1:\n"
		"movl	%2, %%ecx\n"
		"andl	$3, %%ecx\n"
		"jz	2f\n"

		"movb	%%al, %%bl\n"
		"shrl	$8, %%eax\n"
		"xorb	(%%esi), %%bl\n"
		"xorl	(%%edi,%%ebx,4), %%eax\n"

		"decl	%%ecx\n"
		"jz	2f\n"

		"movb	%%al, %%bl\n"
		"shrl	$8, %%eax\n"
		"xorb	1(%%esi), %%bl\n"
		"xorl	(%%edi,%%ebx,4), %%eax\n"

		"decl	%%ecx\n"
		"jz	2f\n"

		"movb	%%al, %%bl\n"
		"shrl	$8, %%eax\n"
		"xorb	2(%%esi), %%bl\n"
		"xorl	(%%edi,%%ebx,4), %%eax\n"
	"2:\n"
		:
		: "a" (val), "g" (buf), "g" (bufsize)
		: "bx", "cx", "dx", "si", "di"
	);
	
	return val;
}
My only recommendation if it's happening with multiple versions of GCC is to completely get rid of them, then start over from scratch, since it looks like there's something from 3.4 that's getting shared w/ everything else.
__________________
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
  #7  
Old 11-22-2008, 03:46 AM
llaarn
Fire Beetle
 
Join Date: Nov 2008
Location: QLD australia
Posts: 4
Angry atoi

for some strange reason my database is throwing wobblies about the atoi not being declared in the scope. Am i doing something wrong or is it a programing error?
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:22 AM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3