This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Shared libraries.


Hello,

I'm trying to build and use shared libraries with Cygwin under Windows 2000.
The first step, i.e. building the library, succeeds. I get a libmylib.so
(together with libmylib.so.1 and limmylib.so.1.0.0). However, linking is a
problem. I've written a small program which uses libmylib.so and try to link
it as follows:

	g++ -o testprogram.exe testprogram.o -L/usr/src/DynLib -lmylib

This results in the error:

	
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld:
cannot find -lmylib

For information the entire output when executing make clean:

rm -f   PrintTest.o  PrintTest.exe.exe PrintTest.d *~
make
make[1]: Entering directory `/usr/src/dynlibtest'
g++ -M  -Wall  PrintTest.cpp > PrintTest.d
g++ -M  -Wall  PrintTest.cpp | sed s/\\.o/.d/ >> PrintTest.d
make[1]: Leaving directory `/usr/src/dynlibtest'
make[1]: Entering directory `/usr/src/dynlibtest'
g++ -Wall    -c -o PrintTest.o PrintTest.cpp
g++  -o PrintTest.exe   PrintTest.o  -L/usr/src/DynLib -lmylib
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld:
cannot find -lmylib
collect2: ld returned 1 exit status
make[1]: *** [PrintTest.exe] Error 1
make[1]: Leaving directory `/usr/src/dynlibtest'
make: *** [clean] Error 2

When using:

	g++ -o PrintTest.exe PrintTest.o libmylib.so

I get the error:

	collect2: ld terminated with signal 11 [Segmentation fault]

Can someone tell me what I'm doing wrong?

Kind regards, Wiebe de Vries.



Pecoma *  ICT-professionals *  http://www.pecoma.nl

Is deze e-mail niet voor u bedoeld? Laat het ons even weten. Bij voorbaat dank. Dit e-mailbericht is gecontroleerd op computervirussen met MIMEsweeper.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]