I am trying to create a Optix7 project examples at https://gitlab.com/ingowald/optix7course as an guide.
I am not using CMake for the project and im having problems linking with the Optix7 library using gcc.
I currently get an
undefined reference to g_optixFunctionTable’` linker error when trying to compile the project.
What is the correct way to link with Optix7, using just gcc/clang?
Did you #include optix_stubs.h? That’s what the course samples do.
If includes are setup right, then that symbol should be defined in your program’s compiled object file, it shouldn’t need to be linked from elsewhere.
BTW does the optix7course CMake setup work for you? You can always explore what CMake is doing in gcc terms by building with VERBOSE=1 on your ‘make’ command. That will let you see all the command lines including lib & .o paths in a working case, so you can use nm to find out where symbols are coming from.
Thanks, I was able to fix it. The problem was i had not included the optix_function_table_definition.h anywhere in my code.