How to enable shared library using SConstruct?

I created a shared library from the Mobile Robot programming toolkit ( MRPT Home Page ). Now I am wondering how to include this in my SConstruct script assembly? I have header files for lib and .so.

I searched googled for a while, but I could not find a solution and therefore would be very happy if someone could point me to a resource that could help or tell me how to do this.

+4
source share
1 answer

A section of the scons User Guide on Linking to Libraries may be useful. You just need to install LIBS in the list of libraries that you want to link, and LIBPATH from the library path. If you are linking to a library named libmrpt.so , use LIBS = ['mrpt'] .

Depending on whether it is a common library for communication or just used once, you can install LIBS and LIBPATH in your environment (1) or for one purpose (2):

 env = Environment(CPPPATH = ['path/to/headers'], LIBS = ['mrpt'], LIBPATH = ['path/to/lib']) # (1) ... myprog = env.Program('my_program', [...sources...], LIBS = ['mrpt'], LIBPATH = ['path/to/lib']) # (2) 
+3
source

Source: https://habr.com/ru/post/1346712/


All Articles