Der Versuch, die OMPL 1.1.0-Bibliothek zu verwenden. Ich verwende diesen Beispielcode (nicht wirklich relevant für das Problem, die zur Laufzeit geschieht):dyld: faule Symbolbindung fehlgeschlagen: Symbol nicht gefunden: __ZN5boost11this_thread5hiden11sleep_untilERK8timespec (have ... 6hidden11sleep_untilERK8timespec)
#include <ompl/base/Goal.h>
#include <ompl/base/goals/GoalState.h>
#include <ompl/base/goals/GoalStates.h>
#include <ompl/base/ProjectionEvaluator.h>
#include <ompl/base/StateSpace.h>
#include <ompl/geometric/PathSimplifier.h>
#include <ompl/base/samplers/UniformValidStateSampler.h>
#include <ompl/base/spaces/RealVectorStateSpace.h>
#include <ompl/base/spaces/SE2StateSpace.h>
#include <ompl/base/spaces/SE3StateSpace.h>
#include <ompl/geometric/SimpleSetup.h>
#include <ompl/geometric/planners/rrt/RRT.h>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
namespace ob = ompl::base;
namespace og = ompl::geometric;
bool isStateValid(const ob::State *state)
{
return true;
}
int main(int /*argc*/, char ** /*argv*/)
{
std::cout << "OMPL version: " << OMPL_VERSION << std::endl;
boost::shared_ptr<ob::SE3StateSpace> space(boost::make_shared<ob::SE3StateSpace>());
ob::RealVectorBounds bounds(3);
bounds.setLow(-1);
bounds.setHigh(1);
space->setBounds(bounds);
og::SimpleSetup ss(space);
//ss.setStateValidityChecker([](const ob::State *state) { return isStateValid(state); });
ob::ScopedState<> start(space);
start.random();
ob::ScopedState<> goal(space);
goal.random();
ss.setStartAndGoalStates(start, goal);
ss.setup();
ss.print();
ob::PlannerStatus solved = ss.solve(1.0);
if(solved)
{
std::cout << "Found solution:" << std::endl;
ss.simplifySolution();
ss.getSolutionPath().print(std::cout);
}
else
std::cout << "No solution found" << std::endl;
return 0;
}
und die folgende Make-Datei:
CXXFLAGS=-I/usr/local/Cellar/ompl/1.1.0/include -I/usr/local/Cellar/boost/1.64.0_1/include
LDLIBS=-lc++ -L/usr/local/Cellar/boost/1.64.0_1/lib/ -lboost_thread-mt -lboost_filesystem -lboost_system -lompl
ompltest: ompltest.o
wenn ich läuft die ausführbare Datei erhalte ich:
dyld: lazy symbol binding failed: Symbol not found: __ZN5boost11this_thread5hiden11sleep_untilERK8timespec
Referenced from: /usr/local/opt/ompl/lib/libompl.11.dylib
Expected in: /usr/local/opt/boost/lib/libboost_thread-mt.dylib
dyld: Symbol not found: __ZN5boost11this_thread5hiden11sleep_untilERK8timespec
Referenced from: /usr/local/opt/ompl/lib/libompl.11.dylib
Expected in: /usr/local/opt/boost/lib/libboost_thread-mt.dylib
Abort trap: 6
ich sehe für das fehlende Symbol in dem Boost-Shared Library, und ich finde:
$ nm -gU /usr/local/opt/boost/lib/libboost_thread-mt.dylib | grep sleep_until.*timespec
0000000000004130 T __ZN5boost11this_thread21no_interruption_point6hidden11sleep_untilERK8timespec
0000000000004390 T __ZN5boost11this_thread6hidden11sleep_untilERK8timespec
gibt es __ZN5boost11this_thread 6hidden 11sleep_untilERK8timespec und nicht 5hiden 11sleep_untilERK8timespec __ZN5boost11this_thread. was ist das? ein Tippfehler? oder beabsichtigt? der Punkt ist, dass ich nicht diese Bibliothek verwenden können, die ich nicht einmal von mir (installiert via Homebrew) bauen hat
EDIT: unmangled Symbolnamen:
$ nm -jgU /usr/local/opt/boost/lib/libboost_thread-mt.dylib | grep sleep_until.*timespec | c++filt
boost::this_thread::no_interruption_point::hidden::sleep_until(timespec const&)
boost::this_thread::hidden::sleep_until(timespec const&)
$ echo __ZN5boost11this_thread5hiden11sleep_untilERK8timespec | c++filt
boost::this_thread::hiden::sleep_until(timespec const&)
Übergeben Sie Ihre Symbole durch 'C++ filt' oder das Äquivalent auf Ihrem System und fügen Sie diese Namen dann in Ihre Frage ein. –