mitsuba-renderer / nanogui

Minimalistic C++/Python GUI library for OpenGL, GLES2/3, Metal, and WebAssembly/WebGL
Other
1.52k stars 189 forks source link

examples fail to build: ld: error: undefined symbol: glfwGetTime #116

Open yurivict opened 2 years ago

yurivict commented 2 years ago
: && /usr/bin/c++ -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -Wall -Wextra -stdlib=libc++ -D_LIBCPP_VERSION -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -fstack-protector-strong -stdlib=libc++ CMakeFiles/example1.dir/src/example1.cpp.o -o example1 -L/usr/local/lib -Wl,-rpath,/usr/local/lib:/disk-samsung/freebsd-ports/x11-toolkits/nanogui/work/.build  libnanogui.so && :
ld: error: undefined symbol: glfwGetTime
yurivict commented 2 years ago

The above is with NANOGUI_BUILD_GLFW=ON. With NANOGUI_BUILD_GLFW=OFF the project installs these files:

include/GLFW/glfw3.h
include/GLFW/glfw3native.h

that conflict with a standalone glfw package.

oikumene commented 2 years ago

It seems that ON and OFF are reversed? include/nanogui/opengl.h includes GLFW/glfw3.h, so these 2 files are needed to be installed with NANOGUI_BUILD_GLFW=ON. If you do not want the conflict with a standalone glfw, you need to specify NANOGUI_BUILD_GLFW=OFF and depend on the standalone glfw package. NANOGUI_BUILD_GLFW=OFF requires the fix in #104 .