0

This is the g++ command running as reported by make:

g++ -o "../build/HeatMethod" obj/Debug/HeatMethod/GradientLerp.o obj/Debug/HeatMethod/MRS.o obj/Debug/HeatMethod/heat_method.o    -L../libraries/glfw-3.2.1/bin -L/usr/local/opt/libunwind-headers/include -L../libraries/vulkansdk-linux/1.2.154.0/x86_64/lib -L../libraries/shaderc/build/libshaderc -L../libraries/googletest/build/lib -L../libraries/benchmark/build/src -L../build -L../libraries/GeographicLib/BUILD/src -lstdc++fs -O0 -ldl -export-dynamic -lstdc++fs -O0 -ldl -pg -export-dynamic ../build/libCoreVulkanEngine.a -lglfw -lunwind -lvulkan -lshaderc_combined -lpthread -lfreetype -lharfbuzz -lcairo -lgtest -lbenchmark -lGeographic

Might be somewhat verbose but focus on the fact that -L../libraries/GeographicLib/BUILD/src is specified in the command.

The linker fails with the following error: ./HeatMethod: error while loading shared libraries: libGeographic.so.19: cannot open shared object file: No such file or directory Well, here are the directory contents:

ls libraries/GeographicLib/BUILD/src/
CMakeFiles  cmake_install.cmake  libGeographic.so  libGeographic.so.19  libGeographic.so.19.1.0  Makefile

The file it claims does not exist is defined inside the directory specified in the command, why cannot it find it?

Cleaned directory through make -C Generated/ clean (Generated is where the makefile is)

Someone helped me get things working by doing: LD_PRELOAD="/home/makogan/vkengine/libraries/GeographicLib/BUILD/src/libGeographic.so" ./HeatMethod

Makogan
  • 8,208
  • 7
  • 44
  • 112
  • The *build* linker can find the libraries, but the *run-time* linker (the program loader) can not. Added a couple of duplicates which should help explain the issue and how to solve it. – Some programmer dude Dec 16 '20 at 02:44
  • According to one of those links, it should be sufficient to export the path. Calling `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./libraries/GeographicLib/BUILD/src/` before compiling and running is resulting in the same behaviour. I tried putting the absolute path in there but no luck. – Makogan Dec 16 '20 at 02:58
  • I also tried setting it through the linker as the second optiion suggests: `-Wl,-rpath=/home/makogan/libraries/GeographicLib/BUILD/src/` But still no luck – Makogan Dec 16 '20 at 03:04
  • That really should be it. Can you please clean your build directory and rerun `make` to build, and copy-paste the *full* and *complete* output into your question? Also if `make` itself succeeds (which is should if my guess is true) then show us how you try to run the program and the (error) output it generates. Then please use `ls -l` to list the library files, so we can see possible soft links and where they point. – Some programmer dude Dec 16 '20 at 03:14

0 Answers0