how to use exception and class in phab project , thanks!

In IDE, I have created a phab project , and I have found that in src
folder there are all c files . but now I have two files, one is *.h,
the other is *.cpp.
In *.h, there is a header include file #include . and
have a class I defined.

when I add these two files to SRC folder , there are some errors about
exception . and In proto.h some errors about the declaration of the
function of class .such as int A::b(), it can’t understand ::, what
shoud I do ?


In my opinion , maybe because the c Project can’t deal with the
exception . how I can solve it . thanks . maybe I can add some
configuration. but I don’t know how to do it ,

can someone give me some advice . Thanks a lot .

can I crate the phab C++ project ?
(notice : in other c++ project ,these two files can work very well)

Phab support C.if you want to use class.you may not use phab,and write
API directly

alisha wrote:

Phab support C.if you want to use class.you may not use phab,and write
API directly

Phab does support c++. You need to specify file names with a .C, .cc, or

…cpp extension when defining your callbacks. When Phab sees that
callback functions are in files ending with .C, .cc, or .cpp, it
generates the necessary support for C++. Note well: All callback
functions must be static and public. The this pointer needs to be
attached to the module (using Pt_ARG_POINTER) so that the static
callback function can call the appropriate instance function. Do not
generate proto.h.

I do this all the time. You can write C cover functions that can be called
by C++ code.

“alisha” <huix_2005@yahoo.com-dot-cn.no-spam.invalid> wrote in message
news:e60a7n$b5g$2@inn.qnx.com

Phab support C.if you want to use class.you may not use phab,and write
API directly

to JohnMcClurkin: my cpp file with class is not my callbacks. I have
wrote it in editor. now the question is : In other callbacks, I
want use this class in my cpp file.
to bilcar and alisa : if I use the API directly. what’s the sentence
for compile. cc or ohers ? I want to support the class and
exception . please write for me in detail .
Thanks !

dxwang wrote:

to JohnMcClurkin: my cpp file with class is not my callbacks. I have
wrote it in editor. now the question is : In other callbacks, I
want use this class in my cpp file.
PhAB automatically generates code for C++ if it detects C++ files.

AFAIK, to make PhAB detect C++ files, specify that the callback
functions be in filenames with a .C, .cc, or .cpp suffix. The callbacks
themselves do not need to be class member functions, they just have to
be in files with C++ type suffixes.

to bilcar and alisa : if I use the API directly. what’s the sentence
for compile. cc or ohers ? I want to support the class and
exception . please write for me in detail .
Thanks !

JohnMcClurkin wrote:

dxwang wrote:

to JohnMcClurkin: my cpp file with class is not my callbacks. I have
wrote it in editor. now the question is : In other callbacks, I
want use this class in my cpp file.

PhAB automatically generates code for C++ if it detects C++ files.
AFAIK, to make PhAB detect C++ files, specify that the callback
functions be in filenames with a .C, .cc, or .cpp suffix. The callbacks
themselves do not need to be class member functions, they just have to
be in files with C++ type suffixes.

to bilcar and alisa : if I use the API directly. what’s the sentence
for compile. cc or ohers ? I want to support the class and
exception . please write for me in detail .
Thanks !

I made it this way: I have rename my A.cpp file (where I have no
callbacks) to A.cxx. In this case Phab will not insert c++ functions
from my cxx file to proto.h. Than in common.mk file I have insert line
EXTRA_SUFFIXES=cxx (I don’t know if IDE automaticaly support this suffix).

Regards
Marian.

Thanks ,everyone!
I have solved it .