Open harshmdeshpande opened 7 years ago
I added the following lines in the CMakeLIsts.txt:
find_package(CCD REQUIRED)
include_directories(${CCD_INCLUDE_DIRS})
target_link_libraries(hello_fcl ${fcl_LIBRARIES} ${CCD_LIBRARIES})
This solved the earlier problem.
Now my code looks like this:
#include <fcl/fcl.h>
#include <fcl/math/triangle.h>
#include <fcl/geometry/bvh/BVH_model-inl.h>
#include <fcl/math/bv/OBBRSS.h>
int main() {
std::vector<fcl::Vector3<double>> vertices;
std::vector<fcl::Triangle> triangles;
typedef fcl::BVHModel<fcl::OBBRSS<double>> Model;
Model *model = new Model();
model->beginModel();
model->addSubModel(vertices, triangles);
return 0;
}
But now I get linker errors like:
undefined reference to `fcl::CollisionGeometry<double>::CollisionGeometry()'
undefined reference to `fcl::Triangle::Triangle()'
undefined reference to `fcl::AABB<double>::AABB()'
Solved it with
target_link_libraries(hello_fcl fcl ${CCD_LIBRARIES}
I know this question has been asked many times, but the solutions discussed doesn't seem to solve it. Also it doesn't help that I am new to writing
CMakeLists.txt
So I have compiled ´libccd´ with the following command:
cmake -G "Unix Makefiles" -DENABLE_DOUBLE_PRECISION=ON -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON ..
Then I compiled fcl with simply
cmake ..
Next, my
CMakeLists.txt
looks like this:In libccd,
compiler.h
looks like this:vec3.h
support.h
Still I get undefined reference errors:
I am using Ubuntu14.04
Edit: The tests are compiled successfully and they pass when I execute them.