Arch compilation error / warning

Post Reply
chef_keeper
Posts: 7
Joined: Thu Apr 07, 2016 8:05 am

Arch compilation error / warning

Post by chef_keeper »

Hello,

slowly trying to get involved into the project I today tried to compile freeablo from source on my archlinux.
On the first attempt I got LOADS (13k+ lines) of errors like :

Code: Select all

In file included from /usr/include/boost/config.hpp:61:0,
                 from /usr/include/boost/property_tree/ptree_fwd.hpp:14,
                 from /usr/include/boost/property_tree/ptree.hpp:15,
                 from /home/olivier/diablo1/components/settings/settings.h:4,
                 from /home/olivier/diablo1/components/../components/diabloexe/diabloexe.h:8,
                 from /home/olivier/diablo1/apps/freeablo/engine/net/../../faworld/playerfactory.h:5,
                 from /home/olivier/diablo1/apps/freeablo/engine/net/netmanager.cpp:4:
usr/include/boost/math/constants/constants.hpp: In static member function ‘static constexpr T boost::math::constants::detail::constant_half<T>::get(const mpl_::int_<5>&)’:
usr/include/boost/math/constants/constants.hpp:277:3: error: unable to find numeric literal operator ‘operator""Q’
   BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000000000000000000000e-01, "5.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
     000000000e-01")
wich I could correct by adding a compilation flag in CMakeLists.tkt thanks to this link : http://stackoverflow.com/questions/2536 ... 28-and-c11

By doing this I could successfully compile with no error, however I still got few warnings :

Code: Select all

[ 99%] Building CXX object test/CMakeFiles/test_serial.dir/serial.cpp.o
In file included from /home/olivier/diablo1/test/serial.cpp:1:0:
/home/olivier/diablo1/test/gtest/src/gtest/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = long int; T2 = long unsigned int]’:
/home/olivier/diablo1/test/gtest/src/gtest/include/gtest/gtest.h:1484:23:   required from ‘static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = long int; T2 = long unsigned int; bool lhs_is_null_literal = false]’
/home/olivier/diablo1/test/serial.cpp:91:5:   required from here
/home/olivier/diablo1/test/gtest/src/gtest/include/gtest/gtest.h:1448:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (expected == actual) {
       ~~~~~~~~~^~~~~~~~~
In file included from /home/olivier/diablo1/components/serial/bitstream.h:132:0,
                 from /home/olivier/diablo1/test/serial.cpp:3:
/home/olivier/diablo1/components/serial/bitstream.inl: In instantiation of ‘Serial::Error::Error Serial::ReadBitStream::handleIntBase(uint64_t&, bool) [with long int minVal = 0l; long int maxVal = 2047l; uint64_t = long unsigned int]’:
/home/olivier/diablo1/components/serial/bitstream.inl:114:60:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleInt(int64_t&) [with long int minVal = 0l; long int maxVal = 2047l; int64_t = long int]’
/home/olivier/diablo1/test/serial.cpp:280:47:   required from here
/home/olivier/diablo1/components/serial/bitstream.inl:50:32: warning: left shift of negative value [-Wshift-negative-value]
             int64_t nBits = ~0 << requiredBits;
                             ~~~^~~~~~~~~~~~~~~
/home/olivier/diablo1/components/serial/bitstream.inl: In instantiation of ‘Serial::Error::Error Serial::ReadBitStream::handleIntBase(uint64_t&, bool) [with long int minVal = -10l; long int maxVal = 10l; uint64_t = long unsigned int]’:
/home/olivier/diablo1/components/serial/bitstream.inl:114:60:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleInt(int64_t&) [with long int minVal = -10l; long int maxVal = 10l; int64_t = long int]’
/home/olivier/diablo1/test/serial.cpp:322:47:   required from here
/home/olivier/diablo1/components/serial/bitstream.inl:50:32: warning: left shift of negative value [-Wshift-negative-value]
In file included from /home/olivier/diablo1/test/serial.cpp:1:0:
/home/olivier/diablo1/test/gtest/src/gtest/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]’:
/home/olivier/diablo1/test/gtest/src/gtest/include/gtest/gtest.h:1484:23:   required from ‘static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int; bool lhs_is_null_literal = false]’
/home/olivier/diablo1/test/serial.cpp:467:5:   required from here
/home/olivier/diablo1/test/gtest/src/gtest/include/gtest/gtest.h:1448:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (expected == actual) {
       ~~~~~~~~~^~~~~~~~~
In file included from /home/olivier/diablo1/components/serial/bitstream.h:132:0,
                 from /home/olivier/diablo1/test/serial.cpp:3:
/home/olivier/diablo1/components/serial/bitstream.inl: In instantiation of ‘Serial::Error::Error Serial::ReadBitStream::handleIntBase(uint64_t&, bool) [with long int minVal = 0l; long int maxVal = 100l; uint64_t = long unsigned int]’:
/home/olivier/diablo1/components/serial/bitstream.inl:114:60:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleInt(int64_t&) [with long int minVal = 0l; long int maxVal = 100l; int64_t = long int]’
/home/olivier/diablo1/components/serial/bitstream.inl:157:56:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleInt(int32_t&) [with long int minVal = 0l; long int maxVal = 100l; int32_t = int]’
/home/olivier/diablo1/test/../apps/freeablo/faworld/position.h:62:17:   required from ‘Serial::Error::Error FAWorld::Position::faSerial(Stream&) [with Stream = Serial::ReadBitStream]’
/home/olivier/diablo1/components/serial/bitstream.inl:194:56:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleObject(SerializableClass&) [with SerializableClass = FAWorld::Position]’
/home/olivier/diablo1/test/serial.cpp:450:25:   required from here
/home/olivier/diablo1/components/serial/bitstream.inl:50:32: warning: left shift of negative value [-Wshift-negative-value]
             int64_t nBits = ~0 << requiredBits;
                             ~~~^~~~~~~~~~~~~~~
/home/olivier/diablo1/components/serial/bitstream.inl: In instantiation of ‘Serial::Error::Error Serial::ReadBitStream::handleIntBase(uint64_t&, bool) [with long int minVal = 0l; long int maxVal = 7l; uint64_t = long unsigned int]’:
/home/olivier/diablo1/components/serial/bitstream.inl:114:60:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleInt(int64_t&) [with long int minVal = 0l; long int maxVal = 7l; int64_t = long int]’
/home/olivier/diablo1/components/serial/bitstream.inl:157:56:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleInt(int32_t&) [with long int minVal = 0l; long int maxVal = 7l; int32_t = int]’
/home/olivier/diablo1/test/../apps/freeablo/faworld/position.h:63:17:   required from ‘Serial::Error::Error FAWorld::Position::faSerial(Stream&) [with Stream = Serial::ReadBitStream]’
/home/olivier/diablo1/components/serial/bitstream.inl:194:56:   required from ‘Serial::Error::Error Serial::ReadBitStream::handleObject(SerializableClass&) [with SerializableClass = FAWorld::Position]’
/home/olivier/diablo1/test/serial.cpp:450:25:   required from here
/home/olivier/diablo1/components/serial/bitstream.inl:50:32: warning: left shift of negative value [-Wshift-negative-value]
are these known issues, how to correct them ?
And finally when I launch freeablo I got : "Failed to open with error 22" I symlinked in directory dia exe and the mpq

Works well with launcher

User avatar
wheybags
Site Admin
Posts: 86
Joined: Thu Apr 24, 2014 9:01 pm
Location: Ireland

Re: Arch compilation error / warning

Post by wheybags »

Not sure why it was failing to compile at first - what boost version are you using? Ad for failing to launch, that's because your setting haven't been configured yet. Running the launcher will fix that. Should probably make the error message tell you that.

chef_keeper
Posts: 7
Joined: Thu Apr 07, 2016 8:05 am

Re: Arch compilation error / warning

Post by chef_keeper »

I got boost 1.61.
Ok it's working like you said : had to run the launcher.
And about the warnings, are there known by you ?

User avatar
wheybags
Site Admin
Posts: 86
Joined: Thu Apr 24, 2014 9:01 pm
Location: Ireland

Re: Arch compilation error / warning

Post by wheybags »

Nope, they weren't, but it looks like just test code anyway. CI should block ant warnings from GCC, but maybe we don't have that enabled for tests?

chef_keeper
Posts: 7
Joined: Thu Apr 07, 2016 8:05 am

Re: Arch compilation error / warning

Post by chef_keeper »

Ant you mean CMake ?
What is CI ?

User avatar
wheybags
Site Admin
Posts: 86
Joined: Thu Apr 24, 2014 9:01 pm
Location: Ireland

Re: Arch compilation error / warning

Post by wheybags »

*any, not ant, sorry.
CI stands for continuous integration, a term with many meanings, but in this context it refers to a build server that will build the repo and run tests on every commit/PR. We use Travis CI for this (https://travis-ci.org)

Post Reply