X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <484135CE.30E20C20@dessent.net>
Date: Sat, 31 May 2008 04:26:06 -0700
From: Brian Dessent <brian@dessent.net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: C S <usmgoldeneagle@gmail.com>
CC: cygwin <cygwin@cygwin.com>
Subject: Re: Cygwin - linker errors - __assert, __itob and __ftol
References: <4ae9b89d0805301549i5ee30654l5f6335544ea38780@mail.gmail.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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/

