public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* RE: Linking VCC with Cygwing Gcc
@ 2002-06-06 22:40 Michnowicz, Simon G
  0 siblings, 0 replies; 5+ messages in thread
From: Michnowicz, Simon G @ 2002-06-06 22:40 UTC (permalink / raw)
  To: 'Pavel Tsekov'

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@syntrex.com]
> Sent:	Thursday, June 06, 2002 8:04 PM
> To:	Michnowicz, Simon G
> Cc:	'cygwin@cygwin.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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Linking VCC with Cygwing Gcc
       [not found] <5D01E8305096D3119D7D00508B5EBBF40A759D33@ntmsg0133.corpmai l.telstra.com.au>
@ 2002-06-06 22:51 ` Larry Hall (RFK Partners, Inc)
  2002-06-06 22:52   ` Linking VCC with cygwing Gcc Christopher Faylor
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2002-06-06 22:51 UTC (permalink / raw)
  To: Michnowicz, Simon G, 'Pavel Tsekov'

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@rfk.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@syntrex.com]
>> Sent: Thursday, June 06, 2002 8:04 PM
>> To:   Michnowicz, Simon G
>> Cc:   'cygwin@cygwin.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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linking VCC with cygwing Gcc
  2002-06-06 22:51 ` Larry Hall (RFK Partners, Inc)
@ 2002-06-06 22:52   ` Christopher Faylor
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Faylor @ 2002-06-06 22:52 UTC (permalink / raw)
  To: cygwin

On Thu, Jun 06, 2002 at 10:28:12PM -0400, Larry Hall (RFK Partners, Inc) wrote:
>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?

Btw, I don't think that it has been mentioned yet, but in this scenario,
the sources for foo.c have to be released with the program, since
foo.exe is a cygwin GPL'ed program.  The source for vclfoo.c doesn't
have to be released (IANAL) since it isn't using any cygwin routines.

cgf

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Linking VCC with Cygwing Gcc
  2002-06-06  2:02 Linking VCC with Cygwing Gcc Michnowicz, Simon G
@ 2002-06-06  6:24 ` Pavel Tsekov
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Tsekov @ 2002-06-06  6:24 UTC (permalink / raw)
  To: Michnowicz, Simon G; +Cc: 'cygwin@cygwin.com'

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Linking VCC with Cygwing Gcc
@ 2002-06-06  2:02 Michnowicz, Simon G
  2002-06-06  6:24 ` Pavel Tsekov
  0 siblings, 1 reply; 5+ messages in thread
From: Michnowicz, Simon G @ 2002-06-06  2:02 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

I have the job of putting a commercial licencing tool (libraries compiled in
VCC) with
cywgin compiled code (on Windows 2000)

The FAQ hints that this should be possible, however I have not been able to
do this.
Is this possible, especially using multi-tasking code?

The FAQ says that object code between the two compilers can be shared,
however
a simple "hello world" program I wrote gives a linker error, i.e.
gcc main.o hello.obj
gives an error like " undefined reference to `_chkesp'"

The situation gets mroe complicated with libraries and dll's.  

Is there any document anywhere describing the process in more detail, or
with examples?

regards

Simon Michnowicz
New Wave - Innovation, Chief Technology Unit
Tel:  03 9253 6769
Fax: 03 9253 6352

Partnering to Deliver Telstra's Competitive Edge.


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-06-07  3:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-06 22:40 Linking VCC with Cygwing Gcc Michnowicz, Simon G
     [not found] <5D01E8305096D3119D7D00508B5EBBF40A759D33@ntmsg0133.corpmai l.telstra.com.au>
2002-06-06 22:51 ` Larry Hall (RFK Partners, Inc)
2002-06-06 22:52   ` Linking VCC with cygwing Gcc Christopher Faylor
  -- strict thread matches above, loose matches on Subject: below --
2002-06-06  2:02 Linking VCC with Cygwing Gcc Michnowicz, Simon G
2002-06-06  6:24 ` Pavel Tsekov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).