X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <4ae9b89d0805311029h60f14df8q631571f0e0361381@mail.gmail.com> Date: Sat, 31 May 2008 12:29:03 -0500 From: "C S" To: cygwin Subject: Re: Cygwin - linker errors - __assert, __itob and __ftol In-Reply-To: <484135CE.30E20C20@dessent.net> 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> 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 thanks for the tip Brian. i thought that i had tried to -mno-cygwin option before but maybe i did not. i have a script file set up now with that command option: $g++ -mno-cygwin -D__int64="long long" -shared -I "C:\Apps\Java\jdk1.6.0_05\include" -I "C:\Apps\Java\jdk1.6.0_05\include\win32" -I "C:\Users\usmsci\My Documents\shapefiles\shapelib-1.2.10\shapelib-1.2.10" -I "C:\Users\usmsci\My Documents\shapefiles\shapelib128_bin_win" -L "C:\Users\usmsci\My Documents\shapefiles\shapelib128_bin_win" com_radiancetech_dss_DataGathererShapeFileReader_DataGathererShapeFileReader.cpp -o libShapeData.dll "C:\Users\usmsci\My Documents\shapefiles\shapelib128_bin_win\shpopen.obj" "C:\Users\usmsci\My Documents\shapefiles\shapelib128_bin_win\dbfopen.obj" errors i get now are: Warning: .drectve '-defaultlib:LIBC' - unrecognized Warning: .drectve '-defaultlib:OLDNAMES' - unrecognized Warning: .drectve '-defaultlib:LIBC' - unrecognized Warning: .drectve '-defaultlib:OLDNAMES' - unrecognized fu000001.o:(.idata$2+0xc): undefined reference to '_libmsvcrt_a_iname' fu000004.o:(.idata$2+0xc): undefined reference to '_libmsvcrt_a_iname' undefined reference to '__nm___itob' Info: resolving __itob by linking to __imp___itob(auto_import) is there possibly another option that i need to add to the command line? thanks again for the help...!! chad On Sat, May 31, 2008 at 6:26 AM, Brian Dessent wrote: > C S wrote: > >> gcc -D__int64="long long" -shared -I\C:\Apps\Java\jdk1.6.0_05\include >> -I\C:\Apps\Java\jdk1.6.0_05\include\win32 -I\c:\Users\usmsci\My >> Documents\shapefiles\shapelib128_bin_win -L\c:\Users\usmsci\My >> Documents\shapefiles\shapelib128_bin_win myFile.cpp -o >> libShapeData.dll c:\Users\usmsci\My >> Documents\shapefiles\shapelib128_bin_win\shpopen.obj >> c:\Users\usmsci\My >> Documents\shapefiles\shapelib128_bin_win\dbfopen.obj >> >> the errors i get are: >> >> Warning: .drectve '-defaultlib:LIBC' - unrecognized >> Warning: .drectve '-defaultlib:OLDNAMES' - unrecognized >> Warning: .drectve '-defaultlib:LIBC' - unrecognized >> Warning: .drectve '-defaultlib:OLDNAMES' - unrecognized >> >> c:\Users\usmsci\My Documents\shapefiles\shapelib128_bin_win\shpopen.o:shpopen.c >> (.text+0x1485):undefined reference to __assert > > You can't mix and match objects like that. Those objects compiled by > MSVC expect to be linked with the MSVCRT runtime, and here you're trying > to link them against the Cygwin runtime. That's the cause of the linker > errors. You can't do that. Every object needs to be consistent in the > runtime that it was compiled against. So either you need to build > everything against MSVCRT (i.e. gcc -mno-cygwin or using MSVC) or you > need to build everything against Cygwin. But you can't do some with one > and some the other. > > Brian > -- 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/