[Scons-users] SharedLibrary issue on Windows

Stefan Seefeld stefan at seefeld.name
Sat Apr 2 19:58:56 EDT 2016


Hello,

I'm trying to build a tiny project using this SConstruct file:

  env = Environment()
  env.SharedLibrary('test', ['lib.cc'])
  env.Program('hello.cc', LIBS=['test'], LIBPATH='.')

which results in the expected output on Linux:

  scons: Reading SConscript files ...
  scons: done reading SConscript files.
  scons: Building targets ...
  g++ -o hello.o -c hello.cc
  g++ -o lib.os -c -fPIC lib.cc
  g++ -o libtest.so -shared lib.os
  g++ -o hello hello.o -L. -ltest
  scons: done building targets.

Executing the same on Windows however yields a link error:

  ...
  link /nologo /dll /out:test.dll /implib:test.lib lib.obj
  link /nologo /OUT:hello.exe /LIBPATH:. test.lib hello.obj
  LINK : fatal error LNK1181: cannot open input file 'test.lib'
  scons: *** [hello.exe] Error 1181
  scons: building terminated because of errors.

as the library link only generates a 'test.dll' file but not a
'test.lib'. (I'm using MSVC 14 on Windows 10)
What am I missing ? (I'm using SCons 2.4.1)

Thanks,
        Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Scons-users mailing list