Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <004601c24db8$28c733e0$46ca09c0@aniraj> Reply-To: "Niraj Agarwal" From: "Niraj Agarwal" To: "Gerrit P. Haase" Cc: References: <001a01c24da3$35aec790$46ca09c0 AT aniraj> <50-323541628 DOT 20020827115036 AT familiehaase DOT de> Subject: Re: DLL Linking Problem Date: Tue, 27 Aug 2002 16:24:47 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by AMaViS perl-11 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id g7RAsFR27923 Hi Gerrit, This is really simple. But problem is that i want to include the dll prepared using vc++ in program written in cygwin environment. Please help me in this regard. Niraj ----- Original Message ----- From: "Gerrit P. Haase" To: "Niraj Agarwal" Cc: Sent: Tuesday, August 27, 2002 3:20 PM Subject: Re: DLL Linking Problem > Niraj schrieb: > > [dll problems with simple dll] > > Your example is not simple, see this really simple example: > > TestDll.c: > ========== > #include > void printVal() > { > printf("Hello World!"); > } > > TestDll.h: > ========== > void printVal(); > > testmain.c: > =========== > #include "TestDll.h" > int main() > { > printVal(); > return 1; > } > > > $ gcc -c TestDll.c -o TestDll.o > > $ gcc -shared -o cygTestDll.dll \ > -Wl,--out-implib=libTestDll.dll.a \ > -Wl,--export-all-symbols \ > -Wl,--enable-auto-import \ > -Wl,--whole-archive TestDll.o \ > -Wl,--no-whole-archive > Creating library file: libTestDll.dll.a > > $ gcc -o testmain testmain.c -L. -lTestDll > > $ ./testmain > Hello World! > > > Gerrit > -- > =^..^=