I am building a program in c++, it is being build on windows using visual studio, but as it will be used on linux and windows I tried to compile it on Ubuntu using g++, but the compiler keeps giving me an error. (It builds fine on windows and does not use any windows dependencies)
The command that I am using is:
g++ -o Test *.cpp -I /home/user/vcpkg/installed/x64-linux/include/ -L /home/user/vcpkg/installed/x64-linux/lib/ -ldl -lbz2 -llzma -lz -lssl -lpthread -lcrypto -lcpprest -lcryptopp
the compiling part is going good, but it gives me an error with the linking, below error is what I keep on getting:
/usr/bin/ld: /home/user/vcpkg/installed/x64-linux/lib//libcrypto.a(dso_dlfcn.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
While looking on stack overflow I saw several people with the same issues, but all I could find as an answer was to add -ldl to the command line, which I did, but did not have any effect.
Does anyone have an idea how to solve this? Any help will be greatly appreciated.