Skip navigation.
Home
The QNX Community Portal

View topic - C++ class static methods in PhAb

C++ class static methods in PhAb

Read-only archive of qnx.gui (Creating graphical applications within a GUI environment, such as Photon or PhAB) at inn.qnx.com

C++ class static methods in PhAb

Postby ncostes » Wed Nov 15, 2006 2:40 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
Active Member
 
Posts: 62
Joined: Tue Aug 03, 2004 9:17 pm

RE: C++ class static methods in PhAb

Postby ncostes » Wed Nov 15, 2006 3:38 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
ncostes
Active Member
 
Posts: 62
Joined: Tue Aug 03, 2004 9:17 pm

Re: C++ class static methods in PhAb

Postby 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
Wojtek Lerch
 


Return to qnx.gui

Who is online

Users browsing this forum: Bing [Bot] and 1 guest