编译Dev-c++胫骨时出错 我在用StIN DEV C++、< /P>编译客户端时遇到了问题。

编译Dev-c++胫骨时出错 我在用StIN DEV C++、< /P>编译客户端时遇到了问题。,c++,c,C++,C,一些背景我目前正试图更改forgottenserver.dev中的代码,这样它就可以让我在一个名为胫骨的游戏中升级到100万以上。我已将Player.h和Player.cpp中的值从uint64\u t更改为uint128\u t。 我在protocolgame.cpp中也做了更改,但这只是经验限制 if(experience > 2147483647) // client debugs after 2,147,483,647 exp msg->put<uint32_t&

一些背景我目前正试图更改forgottenserver.dev中的代码,这样它就可以让我在一个名为胫骨的游戏中升级到100万以上。我已将Player.h和Player.cpp中的值从uint64\u t更改为uint128\u t。 我在protocolgame.cpp中也做了更改,但这只是经验限制

  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
我希望有人能帮我解决这个问题 当做 丹尼斯

编辑:


你可以做一件事来帮助你自己和其他试图帮助你的人,那就是尝试找到一个表现出相同问题的最小程序。有时,你会发现自己的问题,而这样做的过程中,学习一两件事。如果不是,你最好让别人看到问题。仅供参考,编译器是MinGW,而不是Dev-C++。Dev-C++是一个IDE。你的版本似乎也很旧。如果您确实有编译器问题,它可能不会得到修复。再看看,为什么您要尝试使用uint128\t?一个32位整数将保存从-20亿到+20亿的值,并且在两端再加上一点,而无符号32位整数将保存从0到40亿以上的值。Unt64 64 T将保存你的计算机在你的一生中甚至无法计算的值。这是一个跳跃者,我目前正在学习瑞典的编程,我只学习C。C++课程还没有开始。所以你认为我应该只更改Experience>2147483647的值吗?我还听说Uint128_t会让我更容易。那么,你建议我用什么来编译这个呢?!
    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; }