I've created a program to test boost::dll::symbol_location, based on the documentation page here. If I compile the code ($CXX -std=c++17 main.cpp) on my Ubuntu 22.04 system with Clang (clang++), the output is as expected (a.out/libstdc++.so/libc.so etc.); but using GCC (g++), the program outputs that all 5 symbols are located at a.out. On another machine (Debian Crostini), -dl is required; and both GCC and Clang indicate that all 5 symbols are located at a.out. How can I get consistent results?
I've created a program to test
boost::dll::symbol_location
, based on the documentation page here. If I compile the code ($CXX -std=c++17 main.cpp) on my Ubuntu 22.04 system with Clang (clang++), the output is as expected (a.out/libstdc++.so/libc.so etc.); but using GCC (g++), the program outputs that all 5 symbols are located ata.out
. On another machine (Debian Crostini),-dl
is required; and both GCC and Clang indicate that all 5 symbols are located ata.out
. How can I get consistent results?