Optix Linking Errors

Including <optix_stubs.h> gives me a linking error.

Here’s my attempt to link using CMake:

target_include_directories(proj PUBLIC “${OPTIX_DIR}/include”)
find_package(CudaToolKit REQUIRED)
target_link_libraries(proj PUBLIC CUDA::cudart)

Please check if you have the #include <optix_function_table_definition.h> in the right place.

See explanation in https://forums.developer.nvidia.com/t/undefined-symbol-g-optixfunctiontable-during-execution/274690/3