[Scons-users] SharedLibrary + SHLIBVERSION and cygwin

Paweł Tomulik ptomulik at meil.pw.edu.pl
Tue Aug 18 10:23:41 EDT 2015


I'm not sure,

AFAIR I only use packages installed via cygwin's "setup.exe" utility. 
I'm not 100% concious of how that stuff works...

On 2015-08-18 15:57, Bill Deegan wrote:
> Looks like you are using the mingw tools and not native cygwin
> compiler?
> 
> -Bill
> 
> On Tue, Aug 18, 2015 at 8:58 AM, Paweł Tomulik
> <ptomulik at meil.pw.edu.pl> wrote:
> 
>> Hi all,
>> 
>> I just started experimenting with SCons on cygwing trying to port
>> one of my projects to cygwin. Looks like I'm unlucky with the
>> SharedLibrary builder or just misunderstand how stuff works.
>> 
>> At the moment I'm trying to build a minimal project with one
>> executable and one shared library. The following is build report
>> from that simple project (attached) on cygwin, SCons 2.3.4, python
>> 2.7.10:
>> 
>> ptomulik at mwnotebook:$ scons --tree=all
>> scons: Reading SConscript files ...
>> scons: done reading SConscript files.
>> scons: Building targets ...
>> g++ -o cygfoo-0-1-2.dll -Wl,-no-undefined -shared -Wl,-Bsymbolic
>> -Wl,--out-implib,cygfoo-0-1-2.a -Wl,--out-implib=libfoo-0-1-2.dll.a
>> -Wl,--export-all-symbols -Wl,--enable-auto-import
>> -Wl,--whole-archive foo.os -Wl,--no-whole-archive -L.
>> g++ -o main.exe -Wl,-no-undefined main.o -L. -lfoo
>> /bin/ld: cannot find -lfoo
>> collect2: error: ld returned 1 exit status
>> scons: *** [main.exe] Error 1
>> +-.
>> +-cygfoo-0-1-2.dll
>> | +-cygfoo-0-1-2.dll
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-cygfoo-0-1-2.dll
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-foo.cpp
>> +-foo.hpp
>> +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-libfoo-0-1-2.dll.a
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-main.cpp
>> +-main.exe
>> | +-main.o
>> | | +-main.cpp
>> | | +-foo.hpp
>> | | +-/bin/g++
>> | +-/bin/g++
>> | +-cygfoo-0-1-2.dll
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-main.o
>> | +-main.cpp
>> | +-foo.hpp
>> | +-/bin/g++
>> +-SConstruct
>> scons: building terminated because of errors.
>> 
>> This is for SCons 2.3.5:
>> 
>> ptomulik at mwnotebook:$ scons --tree=all
>> scons: Reading SConscript files ...
>> scons: done reading SConscript files.
>> scons: Building targets ...
>> g++ -o foo.os -c -I. foo.cpp
>> g++ -o cygfoo-0-1-2.dll -Wl,-no-undefined -shared -Wl,-Bsymbolic
>> -Wl,--out-implib,cygfoo-0-1-2.a -Wl,--out-implib=libfoo-0-1-2.dll.a
>> -Wl,--export-all-symbols -Wl,--enable-auto-import
>> -Wl,--whole-archive foo.os -Wl,--no-whole-archive -L.
>> g++ -o main.o -c -I. main.cpp
>> g++ -o main.exe -Wl,-no-undefined main.o -L. -lfoo
>> /bin/ld: cannot find -lfoo
>> collect2: error: ld returned 1 exit status
>> scons: *** [main.exe] Error 1
>> +-.
>> +-cygfoo-0-1-2.dll
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-cygfoo.dll
>> +-foo.cpp
>> +-foo.hpp
>> +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-libfoo-0-1-2.dll.a
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-main.cpp
>> +-main.exe
>> | +-main.o
>> | | +-main.cpp
>> | | +-foo.hpp
>> | | +-/bin/g++
>> | +-/bin/g++
>> +-main.o
>> | +-main.cpp
>> | +-foo.hpp
>> | +-/bin/g++
>> +-SConstruct
>> scons: building terminated because of errors.
>> 
>> This is for SCons 2.3.6:
>> 
>> ptomulik at mwnotebook:$ scons --tree=all
>> scons: Reading SConscript files ...
>> scons: done reading SConscript files.
>> scons: Building targets ...
>> g++ -o foo.os -c -I. foo.cpp
>> g++ -o cygfoo-0-1-2.dll -Wl,-no-undefined -shared -Wl,-Bsymbolic
>> -Wl,--out-implib,cygfoo-0-1-2.a -Wl,--out-implib=libfoo-0-1-2.dll.a
>> -Wl,--export-all-symbols -Wl,--enable-auto-import
>> -Wl,--whole-archive foo.os -Wl,--no-whole-archive -L.
>> g++ -o main.o -c -I. main.cpp
>> g++ -o main.exe -Wl,-no-undefined main.o -L. -lfoo
>> /bin/ld: cannot find -lfoo
>> collect2: error: ld returned 1 exit status
>> scons: *** [main.exe] Error 1
>> +-.
>> +-cygfoo-0-1-2.dll
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-cygfoo.dll
>> +-foo.cpp
>> +-foo.hpp
>> +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-libfoo-0-1-2.dll.a
>> | +-foo.os
>> | +-foo.cpp
>> | +-/bin/g++
>> +-main.cpp
>> +-main.exe
>> | +-main.o
>> | | +-main.cpp
>> | | +-foo.hpp
>> | | +-/bin/g++
>> | +-/bin/g++
>> +-main.o
>> | +-main.cpp
>> | +-foo.hpp
>> | +-/bin/g++
>> +-SConstruct
>> scons: building terminated because of errors.
>> 
>> Could someone help me pls? What is the proper way to write a
>> portable SConstruct file, such that the attached project could build
>> on Most platforms? Do I need a versioned shared libs at all on
>> cygwin? It seems like the SONAME stuff does not apply here?
>> 
>> --
>> Paweł Tomulik
>> 
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users [1]
> 
> 
> 
> Links:
> ------
> [1] https://pairlist4.pair.net/mailman/listinfo/scons-users
> 
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users



More information about the Scons-users mailing list