Take the 2-minute tour ×  I'm developing a C++ program under
Linux. I want to put some stuff (to be specific, LLVM bitcode
files, but that's not important) in libraries, so I want the
following directory structure:   How do I find the lib
directory? I tried to compute a relative part from argv[0], but
if /somewhere is in my PATH, argv[0] will just contain myBin. Is
there some way to get this path? Or do I have to set it at
compile time?  How do GNU autotools deal with this? What happens
exactly if I supply the --prefix option to ./configure?  Edit:
The word library is a bit misleading in my case. My library
consist of LLVM bitcode, so it's not an actual (shared) object
file, just a file I want to open from my program. You can think
of it as an image or text file.  share|improve this question If
your library is static, just add -L your/lib/dir; if it is
dynamic, you could have an LD_LIBRARY_PATH, etc... –  Basile
Starynkevitch Mar 24 '12 at 11:59 As I said, the library is an
LLVM Bitcode file, so these won't h