Quote:
Originally Posted by spider661
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.