Using 'LIBS' in scons 'Program' command failed to find static library, why?

前端 未结 1 1199
醉酒成梦
醉酒成梦 2021-01-28 16:27

I\'ve got a \'n.c\' as main function, and \'o.c\' as import function, like below:

$ cat n.c o.c
int f();
int main(){
  f();
  return 0;
}
#include         


        
相关标签:
1条回答
  • 2021-01-28 17:09

    You also need to specify the path where to search for libraries, in this case:

    Program('n.c',LIBS=['o'], LIBPATH=['.'])
    

    Please also check chapter 4 "Building and Linking with Libraries" of our UserGuide, which does not only explain how to create and work with Libraries, it further states that your claim from above "SCons interprets LIBS to use dynamic link shared libraries" is plain wrong. Otherwise the object files would end with *.os instead...

    0 讨论(0)
提交回复
热议问题