delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/03/09:25:28

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <4ae9b89d0806030624m6e9ae9f4u69a7d613fd8ab621@mail.gmail.com>
Date: Tue, 3 Jun 2008 08:24:58 -0500
From: "C S" <usmgoldeneagle AT gmail DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: Cygwin - linker errors - __assert, __itob and __ftol
In-Reply-To: <484135CE.30E20C20@dessent.net>
MIME-Version: 1.0
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
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 -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"

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!

On Sat, May 31, 2008 at 6:26 AM, Brian Dessent <brian AT dessent DOT net> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019