Classes & Phab

Hi,

I’m trying to use a class I developed and Phab is giving me a headache…:slight_smile:

I developed the class by itself using a simple command line type of ‘main’
to test it and quickly debug. Now that it is done, I want to include it in
my GUI front end.

I have tried including the class.h into the callback.c function and Phab
doesn’t know what a ‘class’ declaration is. I tried the ‘extern “C”’ with
no luck and if I repeat the make command by myslef if compiles my
class without any problems.

So, how do you import or add or whatever classes into Photon?

Thanks…

On Wed, 6 Jun 2001 18:08:47 -0400, “Lee R. Copp”
<Lee.R.Copp@MichiganScientific.com> wrote:

Hi,

I’m trying to use a class I developed and Phab is giving me a headache…> :slight_smile:

I developed the class by itself using a simple command line type of ‘main’
to test it and quickly debug. Now that it is done, I want to include it in
my GUI front end.

I have tried including the class.h into the callback.c function and Phab
doesn’t know what a ‘class’ declaration is. I tried the ‘extern “C”’ with
no luck and if I repeat the make command by myslef if compiles my
class without any problems.

So, how do you import or add or whatever classes into Photon?

Use .cc names for files containing c++ code, for example.
Rename callback.c to callback.cc and remove callback.o in the
subdirectory x86 - I don’t recall the exact name. Update the
filename in the callback definition for the relevant widget.

You could also edit Makefiles, defining your own rules for
certain code files.

ako

Thanks…

Lee R. Copp <Lee.R.Copp@michiganscientific.com> wrote:

Hello,

The knowledge base is a great place to find the answer to your questions.
The answer to this question can be found at the following address.
http://qdn.qnx.com/support/bok/solution.qnx?9756

The search page for the knowledge base can be found at the following address.
http://qdn.qnx.com/support/bok/index.html

I hope this helps.

Regards,
Dave B.





Hi,

I’m trying to use a class I developed and Phab is giving me a headache…> :slight_smile:

I developed the class by itself using a simple command line type of ‘main’
to test it and quickly debug. Now that it is done, I want to include it in
my GUI front end.

I have tried including the class.h into the callback.c function and Phab
doesn’t know what a ‘class’ declaration is. I tried the ‘extern “C”’ with
no luck and if I repeat the make command by myslef if compiles my
class without any problems.

So, how do you import or add or whatever classes into Photon?

Thanks…

The answer to this question can be found at the following address.
http://qdn.qnx.com/support/bok/solution.qnx?9756

The search page for the knowledge base can be found at the following
address.
http://qdn.qnx.com/support/bok/index.html

I hope this helps.

Those links helped but when I used the ‘search’ box at the top of the page
(not the drop down lists) and searched for ‘photon c++’ I didn’t get any
hits…Not sure what the difference is but I guess I will start at the index
from now on…

Thanks…

Use .cc names for files containing c++ code, for example.
Rename callback.c to callback.cc and remove callback.o in the
subdirectory x86 - I don’t recall the exact name. Update the
filename in the callback definition for the relevant widget.

I changed all my callbacks from *.c to *.cc and even combined
some of the seperate functions into one file with the function@file.cc
and that streamlined quite a bit…

I also added my header, source, and object files to the ind*files
and now Phab is happy crunching my C++ stuff.

Thanks…