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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -