C++ class static methods in PhAb

bridged with qnx.gui
Post Reply
ncostes

C++ class static methods in PhAb

Post by ncostes » Mon Dec 04, 2006 10:47 pm

I've read the docs and looked at the table that shows how to specify
the functions in various ways (e.g. class::function_name@ and
class::function_name@filename.ext).

I can't get these to generate a project that will build in any way
that uses static class members.

I can use a global C++ function just fine, but not class methods.

Has anyone successfully done this with PhAb? It's supposed to work.

Thanks
Nick

ncostes

RE: C++ class static methods in PhAb

Post by ncostes » Mon Dec 04, 2006 10:47 pm

Here is a sample program. The class is declared in RawDraw.h, the
implementation is in RawDraw.cpp.

If I put the declaration and implementation in RawDraw.h then all is
well (because abmain.cc includes it).

If not, the project never compiles RawDraw.cpp and if you compile it
by hand, the project doesn't link it in with abmain.o

http://www.qrts.com/qnx/rawdraw4.tgz

Thanks
Nick

Wojtek Lerch

Re: C++ class static methods in PhAb

Post by Wojtek Lerch » Mon Dec 11, 2006 2:38 pm

Try renaming your source file to RawDraw.cc. The .cc extension has been
recognized more consistently by more versions of QNX than .cpp (that's
why PhAB generates abmain.cc rather than abmain.cpp).

ncostes wrote:
Here is a sample program. The class is declared in RawDraw.h, the
implementation is in RawDraw.cpp.

If I put the declaration and implementation in RawDraw.h then all is
well (because abmain.cc includes it).

If not, the project never compiles RawDraw.cpp and if you compile it
by hand, the project doesn't link it in with abmain.o

http://www.qrts.com/qnx/rawdraw4.tgz

Thanks
Nick
--
Wojtek Lerch
QNX Software Systems

Post Reply

Return to “qnx.gui”