[Scons-users] SharedLibrary issue on Windows

William Blevins wblevins001 at gmail.com
Sat Apr 2 20:14:49 EDT 2016


Stefan,

Your question isn't specific. If you just want a static library then use
env.Library or env.StaticLibrary instead.

V/R,
William

On Sun, Apr 3, 2016 at 12:58 AM, Stefan Seefeld <stefan at seefeld.name> wrote:

> 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...
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160403/934d2235/attachment.html>


More information about the Scons-users mailing list