Menu

Building on XCode 8.1 (on Sierra)

Help
2016-11-16
2016-11-18
  • Philipp Keller

    Philipp Keller - 2016-11-16

    I saw changes in the source tree from the past week so I was motivated to give the build a go.

    Here's how far I came:

    1. git clone git://git.code.sf.net/p/dunelegacy/code dunelegacy-code
    2. cd dunelegacy-code/IDE/xCode
    3. mkdir -p ~/Library/Frameworks/
    4. cp -rp SDL2.framework ~/Library/Frameworks/
    5. cp -rp SDL2_mixer.framework ~/Library/Frameworks/
    6. open Dune\ Legacy.xcodeproj

    after removing a logDebug statement in QuantBot::build (solving dunelegacy-code/src/players/QuantBot.cpp:857:113: Cannot pass object of non-trivial type 'FixPoint' (aka 'FixPoint32') through variadic method; call will abort at runtime) the compiling was successful.

    But then the linker died with this error message:

    Undefined symbols for architecture x86_64:
      "fmt::internal::PrintfFormatter<char>::format(fmt::BasicWriter<char>&, fmt::BasicCStringRef<char>)", referenced from:
          Map::getTile(int, int) in AStarSearch.o
          std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > fmt::sprintf<int, int>(fmt::BasicCStringRef<char>, int const&, int const&) in AStarSearch.o
          std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > fmt::sprintf<char [42], int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(fmt::BasicCStringRef<char>, char const (&) [42], int const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Bullet.o
          std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > fmt::sprintf<>(fmt::BasicCStringRef<char>) in Bullet.o
          std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > fmt::sprintf<unsigned int>(fmt::BasicCStringRef<char>, unsigned int const&) in Bullet.o
          Map::getTile(int, int) in Bullet.o
          std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > fmt::sprintf<int, int>(fmt::BasicCStringRef<char>, int const&, int const&) in Bullet.o
          ...
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    I thought the problem is with building the strings, e.g. this one:

    THROW(std::domain_error, "Unknown Bullet type %d!", bulletID);

    But I'm not a C coder so I did not figure it out how to solve the issue. Can anyone point me to the right direction?

     

    Last edit: Philipp Keller 2016-11-16
  • RichieQ

    RichieQ - 2016-11-16

    Yeah, the explanation is quite simple: The xCode project is only infrequently updated. This is why it is currently some cpp (that are in the repo but not in added to the xCode project). Try adding src/misc/format.cpp.

    The other problem you reported (logDebug in QuantBot.cpp) seems to be a bug introduced a few commits ago. I just fixed that problem

     
  • Philipp Keller

    Philipp Keller - 2016-11-18

    thanks @RichieQ, I have now a working XCode setup. It feels great to be able to compile this game from my youth :-)
    One question: why are the .PAK files not part of the source code? The game is abandonware and posted on http://www.abandonwaredos.com/abandonware-game.php?abandonware=Dune+II%3A+The+building+of+a+dynasty&gid=1854 so it would be ok to put the PAK files into the source code (and thus also into the target dmg file which can be provided for downloads), no?

     
  • RichieQ

    RichieQ - 2016-11-18

    Even though Dune II is widely available on the net, its copyright hasn't expired. For further information see https://en.wikipedia.org/wiki/Abandonware#Law .

    In order to avoid any legal risk Dune Legacy is not bundled with Dune II content. Instead it is the users responsibility to obtain the PAK files (use an old copy, buy the game on ebay, etc.).

     

Log in to post a comment.