PDA

View Full Version : Linux Compile eoors on lasest CVS (11-05-2004)


kate
11-05-2004, 11:50 AM
I just got the lastest CVS snapshot a few minutes ago and it will not build.

First of all I would like to point out that in the makefiles, the CFLAG -Wstrict-prototypes is not a vailed flag when compiling C++ code, only C or ObjC. Anyway, that's just an anoying warning I get when building.

Anyways, the real errors I get are as follows.

EMuShareMem

In file included from ../zone/client.h:38,
from ../zone/masterentity.h:6,
from Spells.cpp:13:
../zone/../common/Item.h:258: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected
../zone/../common/Item.h:448: error: within this context
../zone/../common/Item.h:261: error: `sint16 Inventory::_HasItem(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, const Item_Struct*, uint8)' is protected
../zone/../common/Item.h:509: error: within this context
../zone/../common/Item.h:263: error: `sint16 Inventory::_HasItemByUse(std::map<sint16, ItemInst*, std::less<sint16>, std::allocator<std::pair<const sint16, ItemInst*> > >&, uint8, uint8)' is protected
../zone/../common/Item.h:511: error: within this context
../zone/../common/Item.h:258: error: `sint16 Inventory::_PutItem(sint16, ItemInst*)' is protected
../zone/../common/Item.h:518: error: within this context
make: *** [Spells.o] Error 1


and in the common code for World and Zone

../common/EQNetwork.cpp: In function `type HI_LOSWAPlong(type)':
../common/EQNetwork.cpp:73: error: `a' undeclared (first use this function)
../common/EQNetwork.cpp:73: error: (Each undeclared identifier is reported only once for each function it appears in.)
../common/EQNetwork.cpp:73: error: no matching function for call to `LO_WORD(<type error>)'
../common/EQNetwork.cpp:73: error: there are no arguments to `HIWORD' that depend on a template parameter, so a declaration of `HIWORD' must be available
../common/EQNetwork.cpp:73: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
make: *** [../common/EQNetwork.o] Error 1


And for thoese of you whoo want to know:
gcc (GCC) 3.4.2 20041025 (Gentoo Hardened Linux 3.4.2-r3, ssp-3.4.1-1, pie-8.7.6.5)


Hope this helps someone.

ellF
11-15-2004, 03:39 AM
I'm struggling with the same errors. Here's what I've found:

1. common/Item.h declares _GetItem(), _PutItem(), and _HasItem() as protected member functions on and around line 243. Commenting out the protected keyword makes them public, which eliminates this error, but it's probably not what should be done. I'm not certain why that error is being thrown -- I'm only a mediocre coder.

2. You can get by the type error by adding -fpermissive to the compiler options in the makefile. I imagine that we gentoo users have more recent versions of gcc than the developers are using for eqemu, and we're running into this error because (as the error message indicates) using an undeclared name has been deprecated.

Hope that helps!

EDIT: An additonal tip for getting this compiled with gcc-3.4: in common/EQNetwork.cpp, on line 73, change HI_LOSWAPlong (type x) to HI_LOSWAPlong (type a)

EDIT: zone/MobAI.cpp makes three calls to abs() without explicitly casting the passed value as an int. This version of gcc, at least, complains of ambiguity. Explicitly casting the values resolves the error. In zone/MobAI.cpp, starting on line 238, change if( ( abs(mob->GetX() - sender->GetX() ) > iArrgoRange)
|| ( abs (mob->GetY() - sender->GetY() ) > iArrgoRange)
|| ( abs (mob->GetZ() - sender->GetZ() ) > iArrgoRange) to if( ( abs ((int)(mob->GetX() - sender->GetX() )) > iArrgoRange)
|| ( abs ((int)(mob->GetY() - sender->GetY() )) > iArrgoRange)
|| ( abs ((int)(mob->GetZ() - sender->GetZ() )) > iArrgoRange)

EDIT: OK, I'm starting to think that I should make a separate thread. Anyways, I found that loading the EMuShareMem library would cause a segmentation fault on my machine, which seems to be a known problem with systems running the 2.6 kernel. The problem was solved http://www.eqemulator.net/forums/viewtopic.php?t=15531&highlight=segmentation+fault here -- you need to edit MMF.cpp and remove all occurances of the string "IPC_NOWAIT", then recompile the library.