nvpro-samples / nvpro_core

shared source code and resources needed for the samples to run
Apache License 2.0
473 stars 113 forks source link

Undefined refrences #44

Closed sivansh11 closed 1 year ago

sivansh11 commented 1 year ago

I am trying out https://nvpro-samples.github.io/vk_mini_path_tracer/index.html I am getting undefined refrences


[build] /usr/bin/ld: CMakeFiles/tut1.dir/main.cpp.o: in function `nvvk::Context::Context()':
[build] /home/sivansh/programming/c++/trying_nvvk/apps/tut1/../../deps/nvpro_core/nvvk/context_vk.hpp:290: undefined reference to `nvvk::GpuCrashTracker::GpuCrashTracker()'
[build] /usr/bin/ld: CMakeFiles/tut1.dir/main.cpp.o: in function `nvvk::Context::~Context()':
[build] /home/sivansh/programming/c++/trying_nvvk/apps/tut1/../../deps/nvpro_core/nvvk/context_vk.hpp:284: undefined reference to `nvvk::GpuCrashTracker::~GpuCrashTracker()'
[build] /usr/bin/ld: ../../../deps/bin_x64/Debug/libnvpro_core_vk.a(context_vk.cpp.o): in function `nvvk::Context::initInstance(nvvk::ContextCreateInfo const&)':
[build] /home/sivansh/programming/c++/trying_nvvk/deps/nvpro_core/nvvk/context_vk.cpp:220: undefined reference to `isAftermathAvailable()'
[build] /usr/bin/ld: /home/sivansh/programming/c++/trying_nvvk/deps/nvpro_core/nvvk/context_vk.cpp:222: undefined reference to `nvvk::GpuCrashTracker::initialize()'
[build] /usr/bin/ld: ../../../deps/bin_x64/Debug/libnvpro_core_vk.a(context_vk.cpp.o): in function `nvvk::Context::initDevice(unsigned int, nvvk::ContextCreateInfo const&)':
[build] /home/sivansh/programming/c++/trying_nvvk/deps/nvpro_core/nvvk/context_vk.cpp:654: undefined reference to `isAftermathAvailable()'
[build] /usr/bin/ld: ../../../deps/bin_x64/Debug/libnvpro_core_vk.a(context_vk.cpp.o): in function `nvvk::ContextCreateInfo::ContextCreateInfo(bool, unsigned int)':
[build] /home/sivansh/programming/c++/trying_nvvk/deps/nvpro_core/nvvk/context_vk.cpp:794: undefined reference to `isAftermathAvailable()'```

#if defined(NVVK_SUPPORTS_AFTERMATH) && defined(NVP_SUPPORTS_VULKANSDK)
is never defined on my system ? 
NBickford-NV commented 1 year ago

Hi Sivansh! I'm trying to reproduce this, but haven't succeeded in getting this error yet. I see you're using a custom trying_nvvk solution here; my best guess is, when you add the executable, like this:

#####################################################################################
# Executable
#
add_executable(${PROJNAME} ${SOURCE_FILES} ${COMMON_SOURCE_FILES} ${GLSL_SOURCES})

is it possible the CMakeLists.txt file for trying_nvvk/apps/tut1 is missing ${COMMON_SOURCE_FILES}? If you happen to have a copy of the trying_nvvk/apps repository, I can try building it as well.

In particular, ${COMMON_SOURCE_FILES} was added to this line in March, so if trying_nvvk/apps/tut1 was copied from vk_mini_path_tracer before then, that could cause this issue when building with a new version of nvpro_core!

The missing implementations of nvvk::GpuCrashTracker::GpuCrashTracker() and isAftermathAvailable() should be in nvpro_core/nvvk/nsight_aftermath_vk.cpp and nvpro_core/nvp/perproject_globals.cpp. These should be included in the COMMON_SOURCE_FILES variable as follows:

Hope this helps - thanks for the issue!