Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com X-Authentication-Warning: modi.xraylith.wisc.edu: khan owned process doing -bs Date: Mon, 10 May 1999 17:01:21 -0500 (CDT) From: Mumit Khan To: Craig_Osterhout cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: B20: undefined reference to cygwin32_conv_to_path In-Reply-To: <37375063.168064CC@nortelnetworks.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 10 May 1999, Craig_Osterhout wrote: > This simple program compiles fine when using the "C" compiler. > Works if it is named "tst.c" and gcc -o tst.exe tst.c. > > Will not work if it named tst.cpp. > When I try to use the "C++" compiler I get "undefined reference > cygwin32_conv.......". I tried linking to the cygwin library. That's because C and C++ are two different languages that use different linkage conventions. cygwin_conv_to_full_win32_path is exported as a "C" function from Cygwin DLL and you need to prototype it such when using it in C++ code. extern "C" void cygwin_conv_to_full_win32_path (const char *path, char *win32_path); and you're all set. Also note that all the cygwin32_* functions have been renamed cygwin_*, although b20.1 still supports the old names. > g++ -o tst.exe tst.cpp -lcygwin -lcygwin is not needed since gcc/c++/g77/etc all add that automatically. Doesn't hurt however. Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com