Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: "Markus Hoenicka" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14995.57435.403000.883588@gargle.gargle.HOWL> Date: Wed, 21 Feb 2001 15:35:55 +0000 (CT0) To: cygwin AT cygwin DOT com Subject: RE: building DLLs (was:RE: New user help - dont understand Mount (and the rest)) In-Reply-To: <000a01c09b97$bcd7a530$b01661c7@holstein-mobile.ASPECTDV.COM> References: <14995 DOT 193 DOT 753000 DOT 902610 AT gargle DOT gargle DOT HOWL> <000a01c09b97$bcd7a530$b01661c7 AT holstein-mobile DOT ASPECTDV DOT COM> X-Mailer: VM 6.75 under Emacs 20.6.1 Kevin Wright writes: > Markus, > > I believe I derived that example from Charles Wilson, so he would have more > expertise in this area. However, I can say from my own experience that I > always have to use a two step process: > > Here's an example from my notes when I built libiconv: > > a) create the .def file using dlltool > (this creates a libfoo.dll.a which can be linked against.) > $ dlltool --export-all --output-def libiconv_.def --dllname libiconv.dll > *.o > NOTE: be careful which .o files are used for this. You don't always want > to export all of the symbols otherwise you'll have problems creating the > dll. > A good rule of thumb is to use the same objects that would normally be > used to create the static library. > This looks good in my case. I get a .def file with a huge amount of exports (this is expected). > b) create the dll using gcc -shared > $ gcc -shared -Wl,--enable-auto-image-base -o libiconv.dll \ > -Wl,--out-implib=libiconv.dll.a libiconv_.def *.o > If I try this, ld exits with a segfault. >[...] > > gcc -Wl,--out-implib,libtest.import.a -shared -o test.dll test.o > This is similar to what I tried before, but I still get: Cannot export _bss_end__: symbol not defined Cannot export _bss_start__: symbol not defined Cannot export _data_end__: symbol not defined Cannot export _data_start__: symbol not defined Creating library file: libosp.dll.a collect2: ld returned 1 exit status Unfortunately I lack a basic understanding of DLLs. What do these messages mean to me? Am I supposed to provide definitions for those symbols or am I supposed to remove some definitions that make the symbols show up in the exports? I'd like to add that the DLL-to-be that I'm fiddling with (libosp.dll/OpenSP) builds on Win32/MSVC and Linux etc, so I assume that the code is prepared for building a DLL. The __declspec() magic is included via #define. Thanks anyway Kevin for the explicit instructions. regards, Markus -- Markus Hoenicka, PhD UT Houston Medical School Dept. of Integrative Biology and Pharmacology 6431 Fannin MSB4.114 Houston, TX 77030 (713) 500-6313, -7477 (713) 500-7444 (fax) Markus DOT Hoenicka AT uth DOT tmc DOT edu http://ourworld.compuserve.com/homepages/hoenicka_markus/ -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple