• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Definition problem

Zolax

New Member
Joined
Feb 16, 2011
Messages
97
Reaction score
1
Hello i'm trying to compile avesta and I got this error
Code:
Kompilator: Default compiler
Building Makefile: "C:\Users\Admin\Documents\source_avesta\Makefile.win"
Wykonywanie  make...
make.exe -f "C:\Users\Admin\Documents\source_avesta\Makefile.win" all
g++.exe -c source_avesta/spells.cpp -o source_avesta/spells.o -I"C:/Users/Admin/Desktop/The Forgotten Dev-Cpp/The Forgotten Dev-Cpp/include"  -D__USE_MYSQL__ -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_OTPCH__   -fexpensive-optimizations -O3

In file included from source_avesta/spells.cpp:23:
source_avesta/house.h:55: error: ISO C++ forbids declaration of `unordered_set' with no type
source_avesta/house.h:55: error: expected unqualified-id before '<' token

make.exe: *** [source_avesta/spells.o] Error 1

Wykonanie zakończone
 
I got from my friend spells.cpp 23 line is
Code:
 #include "house.h"
54 line house .h
Code:
 private:
	typedef std::unordered_set;<uint32_t> PlayerList;
	typedef std::list< std::pair<uint32_t, std::string> > GuildList;

	typedef std::list<std::string> ExpressionList;
	typedef std::list<std::pair<boost::regex, bool> > RegExList;
	std::string list;
	PlayerList playerList;
	GuildList guildList;
	ExpressionList expressionList;
	RegExList regExList;
};
 
Now i have
Code:
make.exe -f "C:\Users\Admin\Documents\source_avesta\Makefile.win" all
g++.exe -c source_avesta/spells.cpp -o source_avesta/spells.o -I"C:/Users/Admin/Desktop/The Forgotten Dev-Cpp/The Forgotten Dev-Cpp/include"  -D__USE_MYSQL__ -D__PROTOCOL_76__ -D__WINDOWS__ -D__USE_OTPCH__   -fexpensive-optimizations -O3

In file included from source_avesta/spells.cpp:23:
source_avesta/house.h:55: error: ISO C++ forbids declaration of `unordered_set' with no type
source_avesta/house.h:55: error: expected `;' before '<' token

make.exe: *** [source_avesta/spells.o] Error 1

Wykonanie zakończone
 
Code:
private:
	typedef std::unordered_set<uint32_t> PlayerList;
	typedef std::list< std::pair<uint32_t, std::string> > GuildList;

	typedef std::list<std::string> ExpressionList;
	typedef std::list<std::pair<boost::regex, bool> > RegExList;
	std::string list;
	PlayerList playerList;
	GuildList guildList;
	ExpressionList expressionList;
	RegExList regExList;
};

class Door : public Item
{
public:
	Door(uint16_t _type);
 
Here you are
Code:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////

#ifndef __OTSERV_HOUSE_H__
#define __OTSERV_HOUSE_H__

#include "definitions.h"
#include "position.h"
#include "housetile.h"
#include "player.h"

#include <stdint.h>
#include <string>
#include <list>
#include <map>

#include "boost/regex.hpp"

class House;
class BedItem;

class AccessList
{
public:
	AccessList();
	~AccessList();

	bool parseList(const std::string& _list);
	bool addPlayer(std::string& name);
	bool addGuild(const std::string& guildName, const std::string& rank);
	bool addExpression(const std::string& expression);

	bool isInList(const Player* player);

	void getList(std::string& _list) const;

private:
	typedef std::unordered_set<uint32_t> PlayerList;
	typedef std::list< std::pair<uint32_t, std::string> > GuildList;

	typedef std::list<std::string> ExpressionList;
	typedef std::list<std::pair<boost::regex, bool> > RegExList;
	std::string list;
	PlayerList playerList;
	GuildList guildList;
	ExpressionList expressionList;
	RegExList regExList;
};

class Door : public Item
{
public:
	Door(uint16_t _type);
	virtual ~Door();

	virtual Door* getDoor() {return this;}
	virtual const Door* getDoor() const {return this;}

	House* getHouse(){return house;}

	//serialization
	virtual Attr_ReadValue readAttr(AttrTypes_t attr, PropStream& propStream);
	virtual bool serializeAttr(PropWriteStream& propWriteStream) const;

	void setDoorId(uint32_t _doorId){ setIntAttr(ATTR_ITEM_DOORID, (uint32_t)_doorId);}
	uint32_t getDoorId() const{ return getIntAttr(ATTR_ITEM_DOORID);}

	bool canUse(const Player* player);

	void setAccessList(const std::string& textlist);
	bool getAccessList(std::string& list) const;

	//overrides
	virtual void onRemoved();
	void copyAttributes(Item* item);

protected:
	void setHouse(House* _house);

private:
	House* house;
	AccessList* accessList;
	friend class House;
};

enum AccessList_t{
	GUEST_LIST = 0x100,
	SUBOWNER_LIST = 0x101,
};

enum AccessHouseLevel_t{
	HOUSE_NO_INVITED = 0,
	HOUSE_GUEST = 1,
	HOUSE_SUBOWNER = 2,
	HOUSE_OWNER = 3,
};

typedef std::list<HouseTile*> HouseTileList;
typedef std::list<Door*> HouseDoorList;
//[ added for beds system
typedef std::list<BedItem*> HouseBedItemList;
//]


class HouseTransferItem : public Item
{
public:
	static HouseTransferItem* createHouseTransferItem(House* house);

	HouseTransferItem(House* _house) : Item(0) {house = _house;}
	virtual ~HouseTransferItem(){}

	virtual bool onTradeEvent(TradeEvents_t event, Player* owner);

	House* getHouse(){return house;}
	virtual bool canTransform() const {return false;}

protected:
	House* house;
};

class House
{
public:
	House(uint32_t _houseid);
	~House();

	void addTile(HouseTile* tile);

	bool canEditAccessList(uint32_t listId, const Player* player);
	// listId special values:
	//	GUEST_LIST     guest list
	//  SUBOWNER_LIST subowner list
	void setAccessList(uint32_t listId, const std::string& textlist);
	bool getAccessList(uint32_t listId, std::string& list) const;

	bool isInvited(const Player* player);

	AccessHouseLevel_t getHouseAccessLevel(const Player* player);
	bool kickPlayer(Player* player, const std::string& name);

	void setEntryPos(const Position& pos) {posEntry = pos;}
	const Position& getEntryPosition() const {return posEntry;}

	void setName(const std::string& _houseName) {houseName = _houseName;}
	const std::string& getName() const {return houseName;}

	void setHouseOwner(uint32_t guid);
	uint32_t getHouseOwner() const {return houseOwner;}

	void setPaidUntil(uint32_t paid){paidUntil = paid;}
	uint32_t getPaidUntil() const {return paidUntil;}

	void setRent(uint32_t _rent){rent = _rent;}
	uint32_t getRent() const {return rent;}

	void setLastWarning(time_t _lastWarning) {lastWarning = _lastWarning;}
	time_t getLastWarning() {return lastWarning;}

	void setPayRentWarnings(uint32_t warnings) {rentWarnings = warnings;}
	uint32_t getPayRentWarnings() const {return rentWarnings;}

	void setTownId(uint32_t _town){townid = _town;}
	uint32_t getTownId() const {return townid;}

	uint32_t getHouseId() const {return houseid;}

	void addDoor(Door* door);
	void removeDoor(Door* door);
	Door* getDoorByNumber(uint32_t doorId);
	Door* getDoorByNumber(uint32_t doorId) const;
	Door* getDoorByPosition(const Position& pos);

	HouseTransferItem* getTransferItem();
	void resetTransferItem();
	bool executeTransfer(HouseTransferItem* item, Player* player);

	HouseTileList::iterator getHouseTileBegin() {return houseTiles.begin();}
	HouseTileList::iterator getHouseTileEnd() {return houseTiles.end();}
	size_t getHouseTileSize() {return houseTiles.size();}

	HouseDoorList::iterator getHouseDoorBegin() {return doorList.begin();}
	HouseDoorList::iterator getHouseDoorEnd() {return doorList.end();}

	void addBed(BedItem* bed);
	HouseBedItemList::iterator getHouseBedsBegin() {return bedsList.begin();}
	HouseBedItemList::iterator getHouseBedsEnd() {return bedsList.end();}

	// Transfers all items to depot and clicks all players (useful for map updates, for example)
	void cleanHouse();

private:
	void updateDoorDescription();
	bool transferToDepot();

	bool isLoaded;
	uint32_t houseid;
	uint32_t houseOwner;
	std::string houseOwnerName;
	HouseTileList houseTiles;
	HouseDoorList doorList;
	//[ added for beds system
	HouseBedItemList bedsList;
	//]
	AccessList guestList;
	AccessList subOwnerList;
	std::string houseName;
	Position posEntry;
	uint32_t paidUntil;
	uint32_t rentWarnings;
	time_t lastWarning;
	uint32_t rent;
	uint32_t townid;

	HouseTransferItem* transferItem;
	Container transfer_container;
};

typedef std::map<uint32_t, House*> HouseMap;

enum RentPeriod_t{
	RENTPERIOD_DAILY,
	RENTPERIOD_WEEKLY,
	RENTPERIOD_MONTHLY,
	RENTPERIOD_YEARLY,
	RENTPERIOD_NEVER,
};

class Houses
{
	Houses();
	~Houses();

public:
	static Houses& getInstance(){
		static Houses instance;
		return instance;
	}

	House* getHouse(uint32_t houseid, bool add = false)
	{
		HouseMap::iterator it = houseMap.find(houseid);

		if(it != houseMap.end()){
			return it->second;
		}
		if(add){
			House* house = new House(houseid);
			houseMap[houseid] = house;
			return house;
		}
		else{
			return NULL;
		}

	}

	House* getHouseByPlayerId(uint32_t playerId);

	bool loadHousesXML(std::string filename);

	bool payHouses();

	HouseMap::iterator getHouseBegin() {return houseMap.begin();}
	HouseMap::iterator getHouseEnd() {return houseMap.end();}

private:
	RentPeriod_t rentPeriod;
	HouseMap houseMap;
};

#endif
 
I still have
Code:
 In file included from source_avesta/spells.cpp:23:
source_avesta/house.h:54: error: ISO C++ forbids declaration of `unordered_set' with no type
source_avesta/house.h:54: error: expected `;' before '<' token

make.exe: *** [source_avesta/spells.o] Error 1
 
Last edited:
Please, delete the Makefile.win and the folder obj from your project folder (should be something like that C:\~~~~\avesta 0.6.5\dev-cpp).

This will "reboot" your compilation.
 
Back
Top Bottom