Skip to content

Commit

Permalink
do not use namespace eigenpy and define bp
Browse files Browse the repository at this point in the history
to fix on 18.04:
```
[ 94%] Building CXX object unittest/CMakeFiles/std_pair.dir/std_pair.cpp.o
cd /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest && /usr/bin/g++  -Dstd_pair_EXPORTS -I/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0 -isystem /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include -isystem /usr/lib/python3/dist-packages/numpy/core/include -isystem /usr/include/python3.6 -isystem /usr/include/eigen3  -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion   -pipe  -O3 -DNDEBUG -fPIC   -std=gnu++14 -o CMakeFiles/std_pair.dir/std_pair.cpp.o -c /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp
/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp: In function 'void init_module_std_pair()':
/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:28:3: error: reference to 'bp' is ambiguous
bp::def("std_pair_to_tuple", std_pair_to_tuple);
^~
/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:8:29: note: candidates are: namespace bp = boost::boost::python;
namespace bp = boost::python;
^
In file included from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/eigenpy.hpp:9:0,
from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:4:
/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/fwd.hpp:81:29: note:                 namespace eigenpy::bp = boost::boost::python;
namespace bp = boost::python;
^
/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:29:3: error: reference to 'bp' is ambiguous
bp::def("copy", copy);
^~
/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:8:29: note: candidates are: namespace bp = boost::boost::python;
namespace bp = boost::python;
^
In file included from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/eigenpy.hpp:9:0,
from /local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/unittest/std_pair.cpp:4:
/local/robotpkg/var/tmp/robotpkg/math/py-eigenpy/work/eigenpy-3.3.0/include/eigenpy/fwd.hpp:81:29: note:                 namespace eigenpy::bp = boost::boost::python;
namespace bp = boost::python;
^
```
  • Loading branch information
nim65s committed Jan 29, 2024
1 parent e55c568 commit 5d08e50
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions unittest/std_pair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ std::pair<T1, T2> copy(const std::pair<T1, T2>& pair) {
}

BOOST_PYTHON_MODULE(std_pair) {
using namespace eigenpy;

enableEigenPy();
eigenpy::enableEigenPy();

typedef std::pair<int, double> PairType;
StdPairConverter<PairType>::registration();
eigenpy::StdPairConverter<PairType>::registration();

bp::def("std_pair_to_tuple", std_pair_to_tuple<int, double>);
bp::def("copy", copy<int, double>);
Expand Down

0 comments on commit 5d08e50

Please sign in to comment.