开发者

How to include a shared library with SConstruct?

I have built a shared library from a part of the Mobile Robot Programming Toolkit ( MRPT-Homepage ). Now I am wondering how to include this in my SConstruct build script? I have the headerfiles for the lib and the .so.

I googled around for some time, but I was no开发者_如何学Got able to figure out a solution and hence would be very happy if someone can point me to a resource that may help or tell me how to do this.


The section from the scons user manual on Linking with Libraries might be helpful. You just need to set LIBS to the list of libraries you want to link against and LIBPATH to the path to the library. If you're linking against a library named libmrpt.so, use LIBS = ['mrpt'].

Depending on whether this is a common library to link with, or just used once, you can set LIBS and LIBPATH in your environment (1), or for a single target (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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜