* RE: [ECOS] C Linkage for C++ Files
@ 2003-01-07 1:45 Dan Conti
2003-01-07 1:55 ` Fred Woolsey
0 siblings, 1 reply; 7+ messages in thread
From: Dan Conti @ 2003-01-07 1:45 UTC (permalink / raw)
To: ecos-discuss
It would be as simple as wrapping the relevant C++ code in 'extern "C"' decls.
-----Original Message-----
From: Fred Woolsey [mailto:fwsbcon@fwsbcon.com]
Sent: Monday, January 06, 2003 5:19 PM
To: ecos-discuss
Subject: Re: [ECOS] C Linkage for C++ Files
Dunno... would it?
Thanks for the help (I think..),
Fred Woolsey
(PS: A question typically expects an answer, not another question.)
----- Original Message -----
From: "Greg Lanthier" <greg_lanthierca@yahoo.ca>
To: "Fred Woolsey" <fwsbcon@fwsbcon.com>; "ecos-discuss"
<ecos-discuss@sources.redhat.com>
Sent: Monday, January 06, 2003 8:11 PM
Subject: Re: [ECOS] C Linkage for C++ Files
> It wouldn't be as simple as wrapping the relevant C++
> code in 'extern "C"' decls, would it?
>
> Greg
>
> --- Fred Woolsey <fwsbcon@fwsbcon.com> wrote: > Hi
> all,
> >
> > Can anyone help explain how to go about compiling a
> > C++ file with C linkage?
> > The eCos reference manual makes a reference to
> > this... Is there a switch or
> > a #pragma for this?
> >
> > Thanks and Best Regards,
> > Fred Woolsey
> >
> >
> >
> > --
> > Before posting, please read the FAQ:
> > http://sources.redhat.com/fom/ecos
> > and search the list archive:
> > http://sources.redhat.com/ml/ecos-discuss
> >
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ECOS] C Linkage for C++ Files
2003-01-07 1:45 [ECOS] C Linkage for C++ Files Dan Conti
@ 2003-01-07 1:55 ` Fred Woolsey
0 siblings, 0 replies; 7+ messages in thread
From: Fred Woolsey @ 2003-01-07 1:55 UTC (permalink / raw)
To: ecos-discuss
Dan,
Thanks... but I'd figured this out already, believe it or not...
<<Getting up on my soapbox- this isn't directed at you, Dan...>>
Those with better knowledge ought to know better... when someone asks what
seems to be a stupid question, it isn't necessary to give a stupid answer...
BTW, Greg- Thanks for the tip... I was able to find some useful info in the
GCC manual by way of a sidelong search for "extern"...
Hoping we both have learned something,
Fred Woolsey
----- Original Message -----
From: "Dan Conti" <danc@fullplaymedia.com>
To: "ecos-discuss" <ecos-discuss@sources.redhat.com>
Sent: Monday, January 06, 2003 8:43 PM
Subject: RE: [ECOS] C Linkage for C++ Files
It would be as simple as wrapping the relevant C++ code in 'extern "C"'
decls.
-----Original Message-----
From: Fred Woolsey [mailto:fwsbcon@fwsbcon.com]
Sent: Monday, January 06, 2003 5:19 PM
To: ecos-discuss
Subject: Re: [ECOS] C Linkage for C++ Files
Dunno... would it?
Thanks for the help (I think..),
Fred Woolsey
(PS: A question typically expects an answer, not another question.)
----- Original Message -----
From: "Greg Lanthier" <greg_lanthierca@yahoo.ca>
To: "Fred Woolsey" <fwsbcon@fwsbcon.com>; "ecos-discuss"
<ecos-discuss@sources.redhat.com>
Sent: Monday, January 06, 2003 8:11 PM
Subject: Re: [ECOS] C Linkage for C++ Files
> It wouldn't be as simple as wrapping the relevant C++
> code in 'extern "C"' decls, would it?
>
> Greg
>
> --- Fred Woolsey <fwsbcon@fwsbcon.com> wrote: > Hi
> all,
> >
> > Can anyone help explain how to go about compiling a
> > C++ file with C linkage?
> > The eCos reference manual makes a reference to
> > this... Is there a switch or
> > a #pragma for this?
> >
> > Thanks and Best Regards,
> > Fred Woolsey
> >
> >
> >
> > --
> > Before posting, please read the FAQ:
> > http://sources.redhat.com/fom/ecos
> > and search the list archive:
> > http://sources.redhat.com/ml/ecos-discuss
> >
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ECOS] C Linkage for C++ Files
2003-01-07 4:27 ` sai jayram
@ 2003-01-07 6:53 ` Fred Woolsey
0 siblings, 0 replies; 7+ messages in thread
From: Fred Woolsey @ 2003-01-07 6:53 UTC (permalink / raw)
To: ecos-discuss
Hi Sai,
Thanks... I did some research after Greg's response and found just what you
so kindly explained... I appreciate it! BTW- I have tried it and it does in
fact work just fine.
Cheers,
Fred Woolsey
----- Original Message -----
From: "sai jayram" <sai@cdotb.ernet.in>
To: "Greg Lanthier" <greg_lanthierca@yahoo.ca>
Cc: "Fred Woolsey" <fwsbcon@fwsbcon.com>; "ecos-discuss"
<ecos-discuss@sources.redhat.com>
Sent: Monday, January 06, 2003 11:36 PM
Subject: Re: [ECOS] C Linkage for C++ Files
>
> On Mon, 6 Jan 2003, Greg Lanthier wrote:
>
> > It wouldn't be as simple as wrapping the relevant C++
> > code in 'extern "C"' decls, would it?
>
>
> This works. I have used such things in my code.
>
> ex: if you want to call a function named "function_in_cplus()" written in
> C++ from a C routine, then the following will do.
>
> C function
>
> ---
> ---
> ---
>
> function_in_cplus();
>
> ---
> ---
> ---
>
>
>
> c++ file
>
> extern "C"
> {
> function_in_cplus();
> }
>
> function_in_cplus()
> {
> ----
> ----
> ----
> ---
> }
>
>
>
>
>
>
>
>
>
> >
> > Greg
> >
> > --- Fred Woolsey <fwsbcon@fwsbcon.com> wrote: > Hi
> > all,
> > >
> > > Can anyone help explain how to go about compiling a
> > > C++ file with C linkage?
> > > The eCos reference manual makes a reference to
> > > this... Is there a switch or
> > > a #pragma for this?
> > >
> > > Thanks and Best Regards,
> > > Fred Woolsey
> > >
> > >
> > >
> > > --
> > > Before posting, please read the FAQ:
> > > http://sources.redhat.com/fom/ecos
> > > and search the list archive:
> > > http://sources.redhat.com/ml/ecos-discuss
> > >
> >
> > ______________________________________________________________________
> > Post your free ad now! http://personals.yahoo.ca
> >
> > --
> > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> > and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> >
> >
>
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ECOS] C Linkage for C++ Files
2003-01-07 1:11 ` Greg Lanthier
2003-01-07 1:19 ` Fred Woolsey
@ 2003-01-07 4:27 ` sai jayram
2003-01-07 6:53 ` Fred Woolsey
1 sibling, 1 reply; 7+ messages in thread
From: sai jayram @ 2003-01-07 4:27 UTC (permalink / raw)
To: Greg Lanthier; +Cc: Fred Woolsey, ecos-discuss
On Mon, 6 Jan 2003, Greg Lanthier wrote:
> It wouldn't be as simple as wrapping the relevant C++
> code in 'extern "C"' decls, would it?
This works. I have used such things in my code.
ex: if you want to call a function named "function_in_cplus()" written in
C++ from a C routine, then the following will do.
C function
---
---
---
function_in_cplus();
---
---
---
c++ file
extern "C"
{
function_in_cplus();
}
function_in_cplus()
{
----
----
----
---
}
>
> Greg
>
> --- Fred Woolsey <fwsbcon@fwsbcon.com> wrote: > Hi
> all,
> >
> > Can anyone help explain how to go about compiling a
> > C++ file with C linkage?
> > The eCos reference manual makes a reference to
> > this... Is there a switch or
> > a #pragma for this?
> >
> > Thanks and Best Regards,
> > Fred Woolsey
> >
> >
> >
> > --
> > Before posting, please read the FAQ:
> > http://sources.redhat.com/fom/ecos
> > and search the list archive:
> > http://sources.redhat.com/ml/ecos-discuss
> >
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ECOS] C Linkage for C++ Files
2003-01-07 1:11 ` Greg Lanthier
@ 2003-01-07 1:19 ` Fred Woolsey
2003-01-07 4:27 ` sai jayram
1 sibling, 0 replies; 7+ messages in thread
From: Fred Woolsey @ 2003-01-07 1:19 UTC (permalink / raw)
To: ecos-discuss
Dunno... would it?
Thanks for the help (I think..),
Fred Woolsey
(PS: A question typically expects an answer, not another question.)
----- Original Message -----
From: "Greg Lanthier" <greg_lanthierca@yahoo.ca>
To: "Fred Woolsey" <fwsbcon@fwsbcon.com>; "ecos-discuss"
<ecos-discuss@sources.redhat.com>
Sent: Monday, January 06, 2003 8:11 PM
Subject: Re: [ECOS] C Linkage for C++ Files
> It wouldn't be as simple as wrapping the relevant C++
> code in 'extern "C"' decls, would it?
>
> Greg
>
> --- Fred Woolsey <fwsbcon@fwsbcon.com> wrote: > Hi
> all,
> >
> > Can anyone help explain how to go about compiling a
> > C++ file with C linkage?
> > The eCos reference manual makes a reference to
> > this... Is there a switch or
> > a #pragma for this?
> >
> > Thanks and Best Regards,
> > Fred Woolsey
> >
> >
> >
> > --
> > Before posting, please read the FAQ:
> > http://sources.redhat.com/fom/ecos
> > and search the list archive:
> > http://sources.redhat.com/ml/ecos-discuss
> >
>
> ______________________________________________________________________
> Post your free ad now! http://personals.yahoo.ca
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [ECOS] C Linkage for C++ Files
2003-01-07 0:35 ` [ECOS] C Linkage for C++ Files Fred Woolsey
@ 2003-01-07 1:11 ` Greg Lanthier
2003-01-07 1:19 ` Fred Woolsey
2003-01-07 4:27 ` sai jayram
0 siblings, 2 replies; 7+ messages in thread
From: Greg Lanthier @ 2003-01-07 1:11 UTC (permalink / raw)
To: Fred Woolsey, ecos-discuss
It wouldn't be as simple as wrapping the relevant C++
code in 'extern "C"' decls, would it?
Greg
--- Fred Woolsey <fwsbcon@fwsbcon.com> wrote: > Hi
all,
>
> Can anyone help explain how to go about compiling a
> C++ file with C linkage?
> The eCos reference manual makes a reference to
> this... Is there a switch or
> a #pragma for this?
>
> Thanks and Best Regards,
> Fred Woolsey
>
>
>
> --
> Before posting, please read the FAQ:
> http://sources.redhat.com/fom/ecos
> and search the list archive:
> http://sources.redhat.com/ml/ecos-discuss
>
______________________________________________________________________
Post your free ad now! http://personals.yahoo.ca
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ECOS] C Linkage for C++ Files
2003-01-06 15:29 ` Grant Edwards
@ 2003-01-07 0:35 ` Fred Woolsey
2003-01-07 1:11 ` Greg Lanthier
0 siblings, 1 reply; 7+ messages in thread
From: Fred Woolsey @ 2003-01-07 0:35 UTC (permalink / raw)
To: ecos-discuss
Hi all,
Can anyone help explain how to go about compiling a C++ file with C linkage?
The eCos reference manual makes a reference to this... Is there a switch or
a #pragma for this?
Thanks and Best Regards,
Fred Woolsey
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-01-07 6:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07 1:45 [ECOS] C Linkage for C++ Files Dan Conti
2003-01-07 1:55 ` Fred Woolsey
-- strict thread matches above, loose matches on Subject: below --
2003-01-04 23:10 [ECOS] Goahead Web Server on i386 Fred Woolsey
2003-01-05 19:21 ` kjell
2003-01-06 15:29 ` Grant Edwards
2003-01-07 0:35 ` [ECOS] C Linkage for C++ Files Fred Woolsey
2003-01-07 1:11 ` Greg Lanthier
2003-01-07 1:19 ` Fred Woolsey
2003-01-07 4:27 ` sai jayram
2003-01-07 6:53 ` Fred Woolsey
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).