Ubuntu 11.04, the OGRE PPA and OpenMW is now not compiling.

Everything about development and the OpenMW source code.
Locked
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Ubuntu 11.04, the OGRE PPA and OpenMW is now not compiling.

Post by lgromanowski »

Sslaxx wrote: The PPAs that OGRE uses for Ubuntu 11.04 have changed the version of Boost used to 1.46, and that seems to make OpenMW fail to compile.

Here is what it does:
make wrote:[ 56%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/__/__/components/files/multidircollection.cpp.o
/home/stuart/CVS/openmw_work/Source/components/files/multidircollection.cpp: In constructor â??Files::MultiDirCollection::MultiDirCollection(const std::vector<boost::filesystem3::path>&, const std::string&, bool)â??:
/home/stuart/CVS/openmw_work/Source/components/files/multidircollection.cpp:58:56: error: no match for call to â??(Files::NameEqual) (const std::string&, boost::filesystem3::path)â??
/home/stuart/CVS/openmw_work/Source/components/files/multidircollection.cpp:19:14: note: candidate is: bool Files::NameEqual::operator()(const std::string&, const std::string&) const
/home/stuart/CVS/openmw_work/Source/components/files/multidircollection.cpp:61:54: error: conversion from â??boost::filesystem3::pathâ?? to non-scalar type â??std::stringâ?? requested
make[2]: *** [apps/openmw/CMakeFiles/openmw.dir/__/__/components/files/multidircollection.cpp.o] Error 1
make[1]: *** [apps/openmw/CMakeFiles/openmw.dir/all] Error 2
make: *** [all] Error 2
Ace (SWE) wrote: That seems to be an issue in the multidircollection class, something to do with boost. Seems like it doesn't know how to convert a boost::filesystem::path to a std::string for comparison purposes, nothing to do with Ogre.
pvdk wrote: Boost changed the return type of the extension() function from:
Boost version 1.43 wrote:string_type extension() const
to:
Boost version 1.46 wrote:path extension() const
A simple path.extension().string() or similar should do the trick.

Edit: Ok, fixed it in my branch and sent a pull request to Zini. Thanks for reporting this problem Sslaxx!
Zini wrote: As I wrote in the pull request comment, this change breaks compiling for older versions of boost. I guess we will have to look into this a bit more. Won't be able to do it within the next few days myself. If someone wants to give it a go, before I get to it, be my guest.
Chris wrote: Adding something like this should make it work for either type:

Code: Select all

std::string& operator=(std::string &lhs, const path &rhs)
{
    lhs = rhs.string();
    return lhs;
}
Zini wrote: Nope. operator= must be a member function. See the C++ standard, section 13.5.3/1.

Anyway, I woke up this morning with an idea how to do it. It doesn't use preprocessor-magic like pvdk's solution and is therefore preferable. Could someone please confirm that it works with newer versions of boost? (boostfix2 branch)
pvdk wrote: Yeah it works, nice solution :)
Locked