Closed rddrdhd closed 10 months ago
Solved changing CMakeLists.txt:
-Wno-changes-meaning
target_link_libraries
and target_include_directories
instead of find_package
, and add pthread
So the file now looks like this:
cmake_minimum_required(VERSION 3.5)
project(main)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-changes-meaning")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(OPENVDB_INCLUDE_DIR "" CACHE PATH "")
set(OPENVDB_LIBRARIES "" CACHE FILEPATH "")
set(TBB_LIBRARIES "" CACHE FILEPATH "")
add_executable(main main.cpp)
target_link_libraries(main ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES} pthread)
target_include_directories(main PUBLIC ${OPENVDB_INCLUDE_DIR})
Environment
Operating System: CentOS 7.9 Version / Commit SHA: 9153c12ed095156aad18f4a0ca7f754b97eb83da Others: I'm new to C++ compilations
Describe the bug
I can't run
make
on my NanoVDB Hello World example. Already succesfully ran OpenVDB example with the library built from this repo.To Reproduce
Steps to reproduce the behavior:
Build & install OpenVDB with NanoVDB:
cmake .. -DUSE_NANOVDB=ON -DNANOVDB_BUILD_UNITTESTS=ON -DNANOVDB_BUILD_EXAMPLES=ON -DNANOVDB_BUILD_BENCHMARK=ON -DNANOVDB_USE_OPENVDB=ON -DCMAKE_INSTALL_PREFIX:PATH=/path/to/my/openvdb/build/install
make -j64
make install
# succesBuild & run NanoVDB Hello World example in main.cpp: (Just the same for OpenVDB example, except the attempt is not successfull for NanoVDB)
cmake -S . -B build
# sucesscd build
make
# error Ommited output ofmake
command:Expected behavior
When I run
make
, I wish to create an executablemain
in the build folder, just like it happened for my OpenVDB Hello World example.Additional context
I checked out a similar issue #1707 which was resolved by adding
#define NANOVDB_USE_OPENVDB
into my main.cpp, but it didn't help.