c++ - How to link using GCC without -l nor hardcoding path for a library that does not follow the libNAME.so naming convention? -
i have shared library wish link executable against using gcc. shared library has nonstandard name not of form libname.so, can not use usual -l option. (it happens python extension, , has no 'lib' prefix.)
i able pass path library file directly link command line, causes library path hardcoded executable.
for example:
g++ -o build/bin/myapp build/bin/_mylib.so
is there way link library without causing path hardcoded executable?
there ":" prefix allows give different names libraries. if use
g++ -o build/bin/myapp -l:_mylib.so other_source_files
should search path _mylib.so.
Comments
Post a Comment