编译Dev-c ++ tibia时出错

时间:2015-03-18 21:26:45

标签: c++ c

使用stians dev c ++,

编译我的客户端时遇到问题

有些背景我正在尝试更改The forgottenserver.dev中的代码,因此它可以让我在一个名为Tibia的游戏中达到100万以上的水平。我已经改变了" uint64_t"的价值。到" uint128_t"在Player.h和player.cpp中。 我在protocolgame.cpp中也发生了变化,但这只是exp限制

  if(experience > 2147483647) // client debugs after 2,147,483,647 exp
 msg->put<uint32_t>(2147483647);

所以回到问题,当我编译我得到大约27-30错误取决于我尝试。经度:

    Compiler: Default compiler
Building Makefile: "C:\Users\Dennis\Desktop\444444444\trunk.r3884\dev-cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Users\Dennis\Desktop\444444444\trunk.r3884\dev-cpp\Makefile.win" all
g++.exe -c ../actions.cpp -o obj//actions.o -I"C:/Stian's Repack Dev-Cpp v2/include/c++"  -D__USE_MYSQL__ -D__USE_SQLITE__ -D__ENABLE_SERVER_DIAGNOSTIC__ -O2   -fexpensive-optimizations -O1

In file included from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian/greg_duration_types.hpp:12,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian/gregorian_types.hpp:22,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/posix_time/posix_time_config.hpp:14,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/posix_time/posix_time_system.hpp:13,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/posix_time/ptime.hpp:12,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/posix_time/posix_time_types.hpp:12,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/asio/detail/select_reactor.hpp:25,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/asio/impl/io_service.ipp:27,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/asio/io_service.hpp:550,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/asio/basic_io_object.hpp:20,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/asio/basic_socket.hpp:24,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/asio/basic_datagram_socket.hpp:25,
                 from C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/asio.hpp:20,
                 from ../otsystem.h:33,
                 from ../baseevents.h:20,
                 from ../actions.h:20,
                 from ../actions.cpp:20:

C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp: In static member function `static bool boost::date_time::gregorian_calendar_base<ymd_type_, date_int_type_>::is_leap_year(typename ymd_type_::year_type) [with ymd_type_ = boost::gregorian::greg_year_month_day, date_int_type_ = long unsigned int]':
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp:182:   instantiated from `static short unsigned int boost::date_time::gregorian_calendar_base<ymd_type_, date_int_type_>::end_of_month_day(typename ymd_type_::year_type, typename ymd_type_::month_type) [with ymd_type_ = boost::gregorian::greg_year_month_day, date_int_type_ = long unsigned int]'
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian/greg_date.hpp:58:   instantiated from here
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp:167: error: ambiguous overload for 'operator%' in 'year % 400'
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp:167: note: candidates are: operator%(int, int) <built-in>
../uint128_t.h:373: note:                 T operator%(const T&, const uint128_t&) [with T = boost::gregorian::greg_year]

C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp:167: error: ambiguous overload for 'operator%' in 'year % 100'
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp:167: note: candidates are: operator%(int, int) <built-in>
../uint128_t.h:373: note:                 T operator%(const T&, const uint128_t&) [with T = boost::gregorian::greg_year]
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp:167: error: ambiguous overload for 'operator%' in 'year % 4'
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/gregorian_calendar.ipp:167: note: candidates are: operator%(int, int) <built-in>
../uint128_t.h:373: note:                 T operator%(const T&, const uint128_t&) [with T = boost::gregorian::greg_year]

In file included from ../player.h:23,
                 from ../actions.cpp:23:
../creature.h: In member function `virtual double Creature::getGainedExperience(Creature*) const':
../creature.h:355: error: conversion from `uint128_t' to `double' is ambiguous
../uint128_t.cpp:24: note: candidates are: uint128_t::operator bool() const
../uint128_t.cpp:28: note:                 uint128_t::operator char() const
../uint128_t.cpp:31: note:                 uint128_t::operator int() const
../uint128_t.cpp:35: note:                 uint128_t::operator uint8_t() const
../uint128_t.cpp:39: note:                 uint128_t::operator uint16_t() const
../uint128_t.cpp:43: note:                 uint128_t::operator uint32_t() const
../uint128_t.cpp:47: note:                 uint128_t::operator uint64_t() const

In file included from ../actions.cpp:24:
../monster.h: At global scope:
../monster.h:189: error: conflicting return type specified for `virtual uint64_t Monster::getLostExperience() const'

../creature.h:556: error:   overriding `virtual uint128_t Creature::getLostExperience() const'

In file included from ../scheduler.h:22,
                 from ../game.h:25,
                 from ../actions.cpp:30:
../dispatcher.h: In constructor `Task::Task(uint32_t, const boost::function<void ()()>&)':
../dispatcher.h:31: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/time.hpp:160: note: candidate 1: T boost::date_time::base_time<T, time_system>::operator+(const typename time_system::time_duration_type&) const [with T = boost::posix_time::ptime, time_system = boost::posix_time::posix_time_system]
../uint128_t.h:337: note: candidate 2: T operator+(const T&, const uint128_t&) [with T = boost::system_time]

../uint128_t.h: In function `bool operator==(const T&, const uint128_t&) [with T = boost::system_time]':
../dispatcher.h:39:   instantiated from here
../uint128_t.h:304: error: `const class boost::posix_time::ptime' used where a `uint64_t' was expected

../dispatcher.h: In member function `bool Task::hasExpired() const':
../dispatcher.h:42: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
C:/Stian's Repack Dev-Cpp v2/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/boost/date_time/time.hpp:130: note: candidate 1: bool boost::date_time::base_time<T, time_system>::operator<(const T&) const [with T = boost::posix_time::ptime, time_system = boost::posix_time::posix_time_system]

../uint128_t.h:315: note: candidate 2: bool operator<(const T&, const uint128_t&) [with T = boost::system_time]

make.exe: *** [obj//actions.o] Error 1

Execution terminated

如果有人可以帮我解决这个问题,我会很高兴 问候, 丹尼斯

编辑:

    static uint64_t getExpForLevel(uint32_t lv) { static std::map<uint32_t, uint64_t> cache; lv--;

std::map<uint32_t, uint64_t>::iterator it = cache.find(lv); if(it != cache.end()) return it->second;

uint64_t exp = ((50ULL * (lv+1ULL) / 3ULL - 100ULL) * (lv+1ULL) + 850ULL / 3ULL) * (lv+1ULL) - 200ULL; cache[lv] = exp; return exp; }

0 个答案:

没有答案