delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/06/06/22:32:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-Id: <5.1.0.14.0.20020606221720.01f8c670@pop.ma.ultranet.com>
X-Sender: lhall AT pop DOT ma DOT ultranet DOT com
Date: Thu, 06 Jun 2002 22:28:12 -0400
To: "Michnowicz, Simon G" <Simon DOT Michnowicz AT team DOT telstra DOT com>,
"'Pavel Tsekov'" <cygwin AT cygwin DOT com>
From: "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com>
Subject: RE: Linking VCC with Cygwing Gcc
In-Reply-To: <5D01E8305096D3119D7D00508B5EBBF40A759D33@ntmsg0133.corpmai
l.telstra.com.au>
Mime-Version: 1.0

Yes but Pavel's question to you was, did you compile the code with the f()
function in VC++ as "Debug" or "Release"?  You should compile it as release
and compile the Cygwin main function with "gcc -o foo foo.c vcfoo.obj", where
vcfoo.obj is your VC++ object file compiled as "Release".  I just tried your
example here and it worked fine (note I'm using the VC++ compiler from the
command line).  

% cl -c -Id:/Program\ Files/Microsoft\ Visual\ Studio/VC98/Include/ vcfoo.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

vcfoo.c
% gcc -o foo foo.c vcfoo.obj
% foo
Hello world


This should be enough to verify for you that this can be done, no?


Larry Hall                              lhall AT rfk DOT com
RFK Partners, Inc.                      http://www.rfk.com
838 Washington Street                   (508) 893-9779 - RFK Office
Holliston, MA 01746                     (508) 893-9889 - FAX



At 10:00 PM 6/6/2002, Michnowicz, Simon G wrote:
>Pavel,
>        thank you for your response. I compiled a simple function f()
>{printf"Hello world\n")
>inside VC++. I then tried to call it from a main() {f();} compiled in
>cygwin.
>
>However the two did not link as I described.  Maybe there is a link/compile
>flag
>I need to set to do it..If so, I do not know what they are..
>
>If you like I could send you the source/obj codes
>
>Simon Michnowicz
>New Wave - Innovation, Chief Technology Unit
>Tel:  03 9253 6769
>Fax: 03 9253 6352
>
>Partnering to Deliver Telstra's Competitive Edge.
>
>> -----Original Message-----
>> From: Pavel Tsekov [SMTP:ptsekov AT syntrex DOT com]
>> Sent: Thursday, June 06, 2002 8:04 PM
>> To:   Michnowicz, Simon G
>> Cc:   'cygwin AT cygwin DOT com'
>> Subject:      Re: Linking VCC with Cygwing Gcc
>> 
>> MSG> The FAQ says that object code between the two compilers can be
>> shared,
>> MSG> however
>> MSG> a simple "hello world" program I wrote gives a linker error, i.e.
>> MSG> gcc main.o hello.obj
>> MSG> gives an error like " undefined reference to `_chkesp'"
>> 
>> Do you have the hello.obj compiled for debugging ?
>
>--
>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/


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

- Raw text -


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