Newbie questions about neutrino, IPC and C++

Bonjour,

I don’t have QNX RTP but i read some documentations
about neutrino and IPC functionalities.
I would like to know if neutrino APIs could be
compile with C++ code. I’m very interesting
in messaging architecture between different
processes but all my code is in C++.
Thx for your help.

Regards,

Kub.
p.s. Do you think it’s crazy to see QNX RTP as
an OS for game consoles ?

Kubernan
Kubernan Technologies, we build infernal machines, AI tools and more
http://www.kubernan-tech.com

Kubernan <kubernan@kubernan-tech.com> wrote:

Bonjour,

I don’t have QNX RTP but i read some documentations
about neutrino and IPC functionalities.
I would like to know if neutrino APIs could be
compile with C++ code.

Absolutely. In general, any C API/library can be called
from C++ – one just has to make sure the function definitions
are encapsulated with:

extern “C” {
/* all the C prototypes etc */
};

Usually this is done in headers with:

#ifdef __cplusplus
extern “C” {
#endif

at the start

and

#ifdef __cplusplus
};
#endif

at the end.

Our headers should have that – if they don’t, let us know and we’ll
update the header, and you can work around it in your own code
with

extern “C” {
#include
};

Kub.
p.s. Do you think it’s crazy to see QNX RTP as
an OS for game consoles ?

Not at all. I think it would be a great use for QNX RTP.

-David

Our headers should have that – if they don’t, let us know and we’ll
update the header, and you can work around it in your own code
with

I looked at a few system header files and I did not find any

#ifdef __cplusplus
extern “C” {
#endif

in there. The thing I don’t understand is that my program works with or
without an extern “C” in my own code.

-Kim

Kim Liu <kliu@terayon.com> wrote:

Our headers should have that – if they don’t, let us know and we’ll
update the header, and you can work around it in your own code
with

I looked at a few system header files and I did not find any

#ifdef __cplusplus
extern “C” {
#endif

in there. The thing I don’t understand is that my program works with or
without an extern “C” in my own code.

Most of the includes include a line like

__BEGIN_DECLS
and
__END_DECLS

These are actually defined to be extern “C” { and }; if __cpluplus
is defined.


cburgess@qnx.com

Kubernan <kubernan@kubernan-tech.com> wrote in message
news:kubernan-04A0DA.13332825102000@inn.qnx.com

Bonjour,

I don’t have QNX RTP but i read some documentations
about neutrino and IPC functionalities.
I would like to know if neutrino APIs could be
compile with C++ code. I’m very interesting
in messaging architecture between different
processes but all my code is in C++.
Thx for your help.

There is no problem with using C++ with neutrino, just remember
that you can’t pass Objects with the IPC functions unless your objects
have a way of transforming themself into a serial byte stream.

I.E. Avoid object with ANY addresses in them, including any virtual
function pointers.

Martin Tilsted <Tiller@adr.dk> wrote in message
news:8t9tmb$pcd$1@inn.qnx.com

Kubernan <> kubernan@kubernan-tech.com> > wrote in message
news:> kubernan-04A0DA.13332825102000@inn.qnx.com> …
Bonjour,

I don’t have QNX RTP but i read some documentations
about neutrino and IPC functionalities.
I would like to know if neutrino APIs could be
compile with C++ code. I’m very interesting
in messaging architecture between different
processes but all my code is in C++.
Thx for your help.

There is no problem with using C++ with neutrino, just remember
that you can’t pass Objects with the IPC functions unless your objects
have a way of transforming themself into a serial byte stream.