X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <4ae9b89d0806030649y6f808f22i745b108450d9b75b@mail.gmail.com> Date: Tue, 3 Jun 2008 08:49:51 -0500 From: "C S" To: cygwin AT cygwin DOT com Subject: Re: Cygwin - linker errors - __assert, __itob and __ftol In-Reply-To: <02d501c8c57e$6da1f1a0$2708a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4ae9b89d0805301549i5ee30654l5f6335544ea38780 AT mail DOT gmail DOT com> <484135CE DOT 30E20C20 AT dessent DOT net> <4ae9b89d0806030624m6e9ae9f4u69a7d613fd8ab621 AT mail DOT gmail DOT com> <02d501c8c57e$6da1f1a0$2708a8c0 AT CAM DOT ARTIMI DOT COM> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 my whole command line script is: g++ -mno-cygwin -D__int64="long long" -Wl,-mno-cygwin -shared -I "C:\Apps\Java\jdk1.6.0_05\include" -I "C:\Apps\Java\jdk1.6.0_05\include\win32" -I "C:\Users\me\My Documents\shapefiles\shapelib-1.2.10\shapelib-1.2.10" -I "C:\Users\me\My Documents\shapefiles\shapelib128_bin_win" -L "C:\Users\me\My Documents\shapefiles\shapelib128_bin_win" myFile.cpp -o libShapeData.dll "C:\Users\me\My Documents\shapefiles\shapelib128_bin_win\shpopen.obj" "C:\Users\me\My Documents\shapefiles\shapelib128_bin_win\dbfopen.obj" yeah i just typed in the 1 wrong. i am actually using an 'L'. if i take the -Wl,-mno-cygwin option out then i get the following error(s): -undefined reference to '_libmsvcrt_a_iname' along with other .drective warnings for -defaultLib such as LIBC and OLDNAMES -undefined reference to __nm___itob Info: resolving __itob by linked to __imp___itob(auto-import) thanks Dave K! On Tue, Jun 3, 2008 at 8:33 AM, Dave Korn wrote: > C S wrote on 03 June 2008 14:25: > >> Brian, >> >> i figured out that not only do i need to compile against the >> no-cygwin flag but also link to it as well. so i tried to add the -Wl >> option like this: >> >> g++ -mno-cygwin -D__int64="long long" -W1-mno-cygwin > > Ah, there's your problem. You typed a '1' instead of an 'l'. And you > forgot the comma. > > No, wait a minute, I was wrong. The actual problem is that you aren't > correctly describing what you've done. Cut and paste stuff from your shell > into your email, don't just make it up or you'll inevitably get it wrong. > > Fortunately I can still tell what the actual error is: > >> the error i get now is: >> >> /usr/lib/gcc/i686-pc-mingw32/3.4.4../../../../i686-pc-mingw32/bin/ld: >> unrecognized emulation mode: no-cygwin >> Supported Emulations: i386pe >> collect2: ld returned exit status >> >> at the prompt i did a ls /lib/gcc/i686-pc-mingw32 and it returned >> 3.4.4 so that seems right. >> >> any clues or suggestions?? thanks all in advance! > > It's not a linker option in that sense; you just need to make sure you've > passed it to gcc or g++ along with all the .o files and it knows how to > drive the linker from that. So just remove your -Wl altogether; the plain > old "-mno-cygwin" that you have immediately after the "g++" will do the job. > The effect it has is to cause g++.exe to pass different -L options to ld. > > > cheers, > DaveK > -- > Can't think of a witty .sigline today.... > > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Problem reports: http://cygwin.com/problems.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/