[Scons-users] SharedLibrary + SHLIBVERSION and cygwin

Paweł Tomulik ptomulik at meil.pw.edu.pl
Tue Aug 18 08:58:26 EDT 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shlibversion-test.tar.gz
Type: application/gzip
Size: 3885 bytes
Desc: not available
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150818/520553e2/attachment.bin>


More information about the Scons-users mailing list