I have a Makefile
setup to build unit tests for my application:
test: app_test.o sdk.o
g++ -L/usr/lib/x86_64-linux-gnu/ --coverage -o test app_test.o sdk.o ./sdk/libNSomeLib.so.2.6 -lboost_unit_test_framework
I have a folder in the root of my project directory called sdk
, which libNSomeLib.so.2.6
is in.
When running locally, I can run make test
and then ./test
and have the tests run.
However, I'm also running the following in Azure DevOps, as part of a build pipeline:
make test
./test
and receive:
./test: error while loading shared libraries: libNSomeLib.so.2: cannot open shared object file: No such file or directory
I had initially tried "installing" this library that I need onto each system I need to run it on, and updating ldconfig
, but it's not feasible so I decided to statically link the library instead, and include the .so
file in the repository itself.
So why is this happening if I'm statically linking, and how would I fix it? It seems to build fine, it's just the running part that isn't working.