简体   繁体   中英

SConscript StaticLibrary attribute error.

I couldn't find any information on the net, so I kindly ask you for one.

I have my build environment set up properly,
My compiler is 'cl' from VS express package.

I try to build static library,
when i set my tools to 'default' everything works, but when i set it to 'msvc'
i have following error:

scons: Reading SConscript files ...
AttributeError: 'SConsEnvironment' object has no attribute 'Library':
  File "D:\N\workspace\cpp\sipher\SConstruct", line 37:
    sCypherlib_gen = env.SConscript(os.path.join(libbuilddir, 'lib_gen', 'SConscript'), 'env')
  File "C:\Python26\Lib\site-packages\scons-2.0.1\SCons\Script\SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Python26\Lib\site-packages\scons-2.0.1\SCons\Script\SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "D:\N\workspace\cpp\proj\src\SConscript", line 5:
    lib = env.Library(target='myProg', source = src)

So i've asked scons gurus and they've told me that i need to add:
'mslink', and 'mslib' to my tools.
They fixed my problem.

What 'bua' said is for Windows. I asked my 'scons guru' and he told me to add the following list to my tools (I'm in Linux)

tools = ['default', 'collect_files', 'getlibs', 'svn_info',
           'convert_template', 'custom_builders', 'nvcc',
           'remove', 'platform_info', 'autodir']

So it depends.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM