-
On Linux, I'm building with OpenVDB by: https://www.openvdb.org/documentation/doxygen/build.html#buildUsingOpenVDB Like: list(APPEND CMAKE_MODULE_PATH "/usr/local/lib64/cmake/OpenVDB/")
find_package(OpenVDB REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC
OpenVDB::openvdb
) I've built OpenVDB by checking out the tag add_compile_definitions(OPENVDB_7_ABI_COMPATIBLE) Also by C++: // https://github.com/AcademySoftwareFoundation/openvdb/issues/139
#define OPENVDB_7_ABI_COMPATIBLE
#include <openvdb/openvdb.h> ErrorBut I'm receiving this linker error when building my project:
A this line of C++ code: openvdb::FloatGrid::Ptr mesh_to_grid(
const Contour &mesh, const openvdb::math::Transform &tr = {}, float exteriorBandWidth = 3.0f, float interiorBandWidth = 3.0f, int flags = 0)
{
openvdb::initialize(); // ***** At this line the linker error is thrown.
return openvdb::tools::meshToVolume<openvdb::FloatGrid>(
ContourDataAdapter{mesh}, tr, exteriorBandWidth, interiorBandWidth,
flags);
} Version 8I tried checking out
I ran out of options to debug this error. Can anybody help? NotePreviously, I was linking to OpenVDB on a different machine just fine. But, installing dependencies and building on a new Linux machine throws the above errors. UpdateInvestigating CMake log indicates that linker is not able to link to any library. Including It may be a general problem. It's not specifically related to OpenVDB. A similar problem is described here: https://stackoverflow.com/q/11112318
Root cause might be:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Fix 🔧The cause of the linker errors was this statement: if(LINUX) The fix was to replace it with this: if(UNIX AND NOT APPLE) This commit fixes the problem: Reference: https://stackoverflow.com/a/40152725/3405291 Strangely, CMake wasn't complaining about anything and just throwing random linker errors. |
Beta Was this translation helpful? Give feedback.
Fix 🔧
The cause of the linker errors was this statement:
if(LINUX)
The fix was to replace it with this:
This commit fixes the problem:
Reference: https://stackoverflow.com/a/40152725/3405291
Strangely, CMake wasn't complaining about anything and just throwing random linker errors.