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 Date: Thu, 10 Apr 2003 10:18:58 -0400 From: Lester Ingber To: Ronald Landheer-Cieslak Cc: cygwin AT cygwin DOT com Subject: Re: -mno-cygwin and "undefined reference to `_impure_ptr'"? Message-ID: <20030410101858.A70274@ingber.com> Reply-To: Lester Ingber References: <20030410131836 DOT GA1480 AT ingber DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from ronald@landheer.com on Thu, Apr 10, 2003 at 02:58:09PM +0200 X-URL-ALT: http://www.alumni.caltech.edu/~ingber/ Ronald: Thanks for the direction to use cygcheck. I had gone back to using '-lm' with mno-cygwin, and this seems to be the source of pulling in cygwin1.dll, as you first suggested. I have put in new files www.ingber.com/private/ASA_DLL.tar.gz www.ingber.com/private/CYGWIN_DLL.tar.gz in case other users want to use this approach. One further question: Do I need to use dlltool at all? I am now running: ------------8<------------ top cut -> bottom ------------->8------------ set Cfiles = ( asa asa_usr asa_usr_cst ) gcc -mno-cygwin -o $i.o -c $i.c end set module = asadll set old_lib = " asa.o asa_usr.o asa_usr_cst.o " set dependency_libs = '' gcc -shared -mno-cygwin -o ${module}.dll \ -Wl,--out-implib=lib${module}.dll.a \ -Wl,--export-all-symbols \ -Wl,--export-dynamic \ -Wl,--add-stdcall-alias \ -Wl,--enable-auto-import \ -Wl,--whole-archive ${old_lib} \ -Wl,--no-whole-archive ${dependency_libs} echo EXPORTS > ${module}.def nm ${module}.dll | grep ' T _' | sed 's/.* T _//' >> ${module}.def dlltool --def ${module}.def --dllname ${module}.dll --output-lib ${module}.a gcc -mno-cygwin -O -o run_main main.c -L./ -l${module} ${dependency_libs} ./run_main ------------8<------------ bottom cut <- top ------------->8------------ and this works as well in Excel with and without running dlltool, but I do not know if other utilities want to also see a .a file. Thanks. Lester On Thu, Apr 10, 2003 at 02:58:09PM +0200, Ronald Landheer-Cieslak wrote: : Date: Thu, 10 Apr 2003 14:58:09 +0200 (CEST) : From: Ronald Landheer-Cieslak : To: Lester Ingber : cc: cygwin AT cygwin DOT com : Subject: Re: -mno-cygwin and "undefined reference to `_impure_ptr'"? : In-Reply-To: <20030410131836 DOT GA1480 AT ingber DOT com> : : On Thu, 10 Apr 2003, Lester Ingber wrote: : > Under ASA_DLL, a complaint still is made that it cannot find : > cygwin1.dll? : Which means you still linked with the DLL. Did you do what Danny Smith : told you to do (i.e. compile everything with -mno-cygwin) and are you : *sure* that you're not linking in any other Cygwin-related libraries (most : notably libcygwin.a, but you may be linking them in through something : else). libg.a is an example of a symlink to libcygwin.a - you're not : linking to that, are you? : : Just run cygcheck on your DLL and see if it depends on cygwin1.dll. As : long as that is the case, you're linking with something that needs Cygwin : - find out what it is and get rid of it :) : : You could always just download MinGW (from www.mingw.org) and try : compiling in the MSYS environment. MSYS is a Cygwin fork but the mingw : compiler doesn't stick in the cygwin dependencies by default. : : HTH : : rlc : -- Prof. Lester Ingber ingber AT ingber DOT com ingber AT alumni DOT caltech DOT edu www.ingber.com www.alumni.caltech.edu/~ingber -- 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/