QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
PhAB and C++ |
Ref. No. |
QNX.000009756 |
Category(ies) |
Development, Configuration |
Issue |
We will be using C++ with PhAB developement. Way back, PhAB knew nothing about C++, and the only way to make C++ work was to use a Makefile trick to compile .c files as C++.
Is this still an issue?
|
Solution |
No, it is not. PhAB recognizes .cc, .c and .cpp as C++ extensions and generates appropriate #ifdefs and extern "C's". Now, you can mix C++ with C. There is special syntax to specify C++ function as callbacks to PhAB (i.e. See "Function names and filenames", Working with Code, Programmer Guide).
You have to disable the generation of prototypes in "proto.h", because the parser doesn't know how to scan C++ code. To disable this you can go to the 'Application' menu then the 'Startup Info/Modules' and unselect the 'Scan Source Files for Prototypes' checkbox.x0d x0d
Do not try to use non-static class member functions for PhAB callbacks.
|
|