2012-12-04 99 views
2

我正在嘗試使用一個使用g ++的示例庫Mocapy ++。找不到Boost

安裝時通過調用cmake .我得到這個錯誤:

-- Boost version: 1.52.0 
-- Boost version: 1.52.0 
-- Found the following Boost libraries: 
-- serialization 
-- program_options 
-- thread 
running /usr/bin/cmake -E create_symlink "/home/vishalnus/Downloads/Mocapy++-1.07 /examples/data" "/home/vishalnus/Downloads/Mocapy++-1.07/examples/data" 2>&1 
-- Could NOT find Boost 
-- Could NOT find Boost 
-- Could NOT find Boost 
-- Could NOT find Boost 
-- Boost version: 1.52.0 
-- Found the following Boost libraries: 
-- serialization 
-- Could NOT find Boost 
-- Boost version: 1.52.0 
-- Found the following Boost libraries: 
-- serialization 
-- Could NOT find Boost 
-- Configuring done 
-- Generating done 
-- Build files have been written to: <home>/Downloads/Mocapy++-1.07 

現在,如果我嘗試調用make我得到的錯誤:

[ 1%] Building CXX object src/CMakeFiles/Mocapy.dir/discrete/discretedensities.cpp.o 
In file included from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/../framework/../utils/utils.h:47:0, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/../framework/essbase.h:29, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/discreteess.h:24, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/discretepriors.h:31, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/densitiesbase.h:30, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.h:29, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.cpp:22: 
/home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/../framework/../utils/mdarray.h: In instantiation of ‘void mocapy::MDArray<T>::clip(double, double) [with T = double]’: 
/home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.cpp:61:32: required from here 
/home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/../framework/../utils/mdarray.h:1252:4: error: ‘max’ was not declared in this scope, andno declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] 
    In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0, 
      from /usr/include/c++/4.7/ios:41, 
      from /usr/include/c++/4.7/ostream:40, 
      from /usr/local/include/boost/archive/text_oarchive.hpp:19, 
      from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.h:25, 
      from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.cpp:22: 
/usr/include/c++/4.7/bits/stl_algobase.h:254:5: note: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ declared here, later in the translation unit 
In file included from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/../framework/../utils/utils.h:47:0, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/../framework/essbase.h:29, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/discreteess.h:24, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/discretepriors.h:31, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/densitiesbase.h:30, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.h:29, 
from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.cpp:22: 
/home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/../framework/../discrete/../framework/../utils/mdarray.h:1253:4: error: ‘min’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] 
    In file included from /usr/include/c++/4.7/bits/char_traits.h:41:0, 
      from /usr/include/c++/4.7/ios:41, 
      from /usr/include/c++/4.7/ostream:40, 
      from /usr/local/include/boost/archive/text_oarchive.hpp:19, 
      from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.h:25, 
      from /home/vishalnus/Downloads/Mocapy++-1.07/src/discrete/discretedensities.cpp:22: 
    /usr/include/c++/4.7/bits/stl_algobase.h:233:5: note: ‘template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’ declared here, later in the translation unit 
    make[2]: *** [src/CMakeFiles/Mocapy.dir/discrete/discretedensities.cpp.o] Error 1 
    make[1]: *** [src/CMakeFiles/Mocapy.dir/all] Error 2 
    make: *** [all] Error 2 

請讓我知道噸如何去了解。 謝謝!

回答

2

CMake過程中沒有錯誤(看起來您可以忽略關於找不到Boost的多個消息)。

有一個在Mocapy ++代碼中的錯誤,它試圖用最小/最大代替的std ::分鐘/的std ::最大的,這就是爲什麼編譯失敗,你(現在仍然失敗,他們的最新發布)。

如果你想解決這個問題,編輯​​,找到MDArray<T>::clip和替換功能這兩行:

values[i] = max(minimum, values[i]); 
values[i] = min(maximum, values[i]); 

有:

values[i] = std::max(minimum, values[i]); 
values[i] = std::min(maximum, values[i]); 

輸入 「make」,等待和享受:)