On 08/07/2017 06:25 PM, sunlf wrote: > > 发件人: Nash, George [mailto:[email protected]]
> As a general rule the files used for the lib are *.a or *.so files for linux > or *.lib or *.dll for windows. I have only seen *.o files used as lib in one > project (non IoTivity) and it was a work around for a really unusual build > time issue. > > George > > From: [email protected] > [mailto:[email protected]] On Behalf Of sunlf > For IoT project, scons is used. And I have a question about using lib. > > > > 1. May I use .o file as the lib? In scons terms, to be a little more specific, you can list object files in the program target rule - the Program() builder. env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.cpp']) On the other hand, the LIBS construction variable is intended to look up the libraries according to some rules... on Linux you take the library name 'foo' from LIBS and looks first for 'libfoo.so', then for 'libfoo.a'. So using a .o object file as a LIBS entry will not give you joy. On the other hand it's very easy to turn your .o files into a static library, just use a StaticLibrary() builder. _______________________________________________ iotivity-dev mailing list [email protected] https://lists.iotivity.org/mailman/listinfo/iotivity-dev
