CIS565-Fall-2017 / Project3-CUDA-Path-Tracer

18 stars 47 forks source link

libglfw3.a(x11_clipboard.c.o): undefined reference to symbol 'XConvertSelection' #38

Open akav opened 6 years ago

akav commented 6 years ago

Library linking sequence as set in CMakeList: list(APPEND CMAKE_EXE_LINKER_FLAGS "-lX11 -lXxf86vm -lXrandr -lXi") cause the linker to break with the aforementioned error w/ Ubuntu 14.04 and 16.04, gcc 4.9.

pjcozzi commented 6 years ago

Thanks @akav.

@shehzan10 any ideas?

shehzan10 commented 6 years ago

Unfortunately I don't have access to a Linux machine with CUDA.

@akav Do you think you can try linking the shared glfw library? On Ubuntu 16.04, you can install it using sudo apt install libglfw3-dev and then change the library name from glfw3 to glfw in CMakeLists.txt.

akav commented 6 years ago

@shehzan10 I have just tried it with same results.

To get round the issue of not having a Linux machine, under Windows 10 you can enable the Linux subsystem, then download the network deb for CUDA 8 and install CUDA just fine. You can also do the same within a virtual machine under VirtualBox or VMWare Player.

akav commented 6 years ago

I went back to GLFW instructions: http://www.glfw.org/docs/3.0/build.html

And have added: find_package(PkgConfig REQUIRED) pkg_search_module(GLFW REQUIRED glfw3)

and then:

target_link_libraries(${CMAKE_PROJECT_NAME} src

stream_compaction # TODO: uncomment if using your stream compaction

${GLFW_LIBRARIES}
${CORELIBS}
)

Build is successful now when dynamic linking GLFW and works static linking when switching to ${GLFW_STATIC_LIBRARIES} in target_link_libraries.

shehzan10 commented 6 years ago

Sounds great! Sorry about the delay on my end. My laptop is failing to boot so my problems have simply been compounded.

I'll try to investigate this in more detail once I'm back on track.

akav commented 6 years ago

No worries, take your time. Just wanted to point out also that the same issue I faced in this source tree is evident in other CIS565 projects (including CUDA rasterizer). Making the change should help fix build issues for all other projects as well.

akav commented 6 years ago

@shehzan10 just wanted to catch up on this. Have you tried the fix I mentioned?