Reputation: 3657
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 not 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.
Upvotes: 4
Views: 8289
Reputation: 15972
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)
Upvotes: 4