Photon 1.14 to Photon 2- porting

Hi:

I am trying to recompile a copy of slideshow from QNX4/Photon 1.14 to
QNXRTP Photon 2. I get a large number of undefined references. Some of
which are :

ApMessageDialog,
ApClearWidget,
PxLoadImage,
PxLoadGIF.

These functions are not mentioned in Help.

Am I missing a reference to a library ?
If not are there conversion/migration functions available (a la
qnx4->nto) ?

TIA…
Andy.



\

Andy Rhind <camerons_act@bigpond.com> wrote:

Hi:

I am trying to recompile a copy of slideshow from QNX4/Photon 1.14 to
QNXRTP Photon 2. I get a large number of undefined references. Some of
which are :

When you say “recompile”, I assume you mean you did re-generate the code
using the new PhAB for RTP – is that correct?

ApMessageDialog,
ApClearWidget,

These two don’t exist in Photon 2 – change the code to use
PtAskQuestion() and PtClearWidget() instead.

PxLoadImage,
PxLoadGIF.

These two should be in a library called “libphexlib.a”. Does your
Makefile tell the linker to use that library? (Before you ask: yes, it
should do that by default.) Could I see the output from make – both the
commands and the error messages?

These functions are not mentioned in Help.

Uh… PxLoadImage() is, isn’t it?


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Wojtek Lerch <wojtek@qnx.com> wrote:
: These two don’t exist in Photon 2 – change the code to use
: PtAskQuestion() and PtClearWidget() instead.

PtAskQuestion() has been deprecated. Use PtAlert(), PtNotice(), or
PtPrompt() instead.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems Ltd.

Wojtek:
Thanks for the reply.

Wojtek Lerch wrote:

Andy Rhind <> camerons_act@bigpond.com> > wrote:
Hi:

I am trying to recompile a copy of slideshow from QNX4/Photon 1.14 to
QNXRTP Photon 2. I get a large number of undefined references. Some of
which are :

When you say “recompile”, I assume you mean you did re-generate the code
using the new PhAB for RTP – is that correct?

I took the blunderbus approach and copied the whole slideshow directory

from QNX4 to RTP, as it is. Then opened it in PhAb (RTP), generated it
and then tried to make it. Thats when the differences showed up.

ApMessageDialog,
ApClearWidget,

These two don’t exist in Photon 2 – change the code to use
PtAskQuestion() and PtClearWidget() instead.

Done - and it works- thank you…

PxLoadImage,
PxLoadGIF.

These two should be in a library called “libphexlib.a”. Does your
Makefile tell the linker to use that library? (Before you ask: yes, it
should do that by default.) Could I see the output from make – both the
commands and the error messages?

The following are the makefile and the makefile output. I have got to
the point now where most things are found except that I get “undefined
reference PxLoadImage”. As you can see I have even forced the necessary
library.

Application Makefile

CFLAGS = -g -I.
LDFLAGS = -g -Bstatic $(DEBUG) -l Ap -l phexlib -l /usr/photon/lib/libphexlib.a -l ph -l phrender $(PHABOPTS) -Bdynamic -l m
SDFLAGS = -g $(DEBUG) -l Ap -l phexlib -l /usr/photon/lib/libphexlib.a -l ph -l phrender $(PHABOPTS) -Bdynamic -l m

include abOfiles
MYOBJ =

include abSfiles
MYSRC =

include abHfiles
MYHDR =

Application Program

app: $(ABOBJ) $(MYOBJ)
$(LD) $(LDFLAGS) $(ABOBJ) $(MYOBJ) -M
-o slideshow -o Phem
/usr/photon/appbuilder/appbind slideshow

shr: $(ABOBJ) $(MYOBJ)
$(LD) $(SDFLAGS) $(ABOBJ) $(MYOBJ) -M
-o slideshow -o Phmem
/usr/photon/appbuilder/appbind slideshow

Headers

$(ABOBJ) $(MYOBJ): $(MYHDR)

Prototype Generation

proto:
approto -p $(ABSRC) $(MYSRC) > proto.h

initialize.o : globals.h

clean:
rm *.o

The output of the make is :-

cc -g -I. -c filesel_setup.c -o filesel_setup.o
cc -g -I. -c initialize.c -o initialize.o
cc -g -I. -c screen.c -o screen.o
cc -g -Wc,-O3 -fomit-frame-pointer -Wl,-O3 -fomit-frame-pointer
-l Ap -l phexlib -l /x86/usr/lib/libphexlib.a -l ph -l phrender
-Bdynamic -l m abmain.o base_focus.o base_setup.o exit_app.o filesel_open.o
filesel_setup.o initialize.o screen.o -M
-o slideshow -o Phmem
screen.o: In function screen_read': screen.o(.text+0x66f): undefined reference to PxLoadImage’
cc: /usr/bin/ld error 1
make: *** [shr] Error 1

I have copied/pasted the example from the PxLoadImage halp page. This
compiles and links without any problem, using the same (or similar)
linking commands.
So the library is intact and contains the function.
Any ideas?

Also I see that phappbind has been replaced with phabbind. phabbind
seems to expect a directory structure that doesnt match the one that I
have. I get the feeling that slideshow was hand written a long time ago.
Its becomming a better learning exercise than I expected…


Thanks
Andy.

These functions are not mentioned in Help.

Uh… PxLoadImage() is, isn’t it?


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.


NOTE- New phone,fax numbers

Andy Rhind
Symmetry Innovations Pty Ltd.
PO Box 3204
Weston
A.C.T 2611,
Australia
E-Mail: andy@symmetry.com.au
Phone: 61-2-6248 6611
Fax : 61-2-6248 8383

Andy Rhind <camerons_act@bigpond.com> wrote:

Wojtek Lerch wrote:
Andy Rhind <> camerons_act@bigpond.com> > wrote:

PxLoadImage,
PxLoadGIF.

These two should be in a library called “libphexlib.a”. Does your
Makefile tell the linker to use that library? (Before you ask: yes, it
should do that by default.) Could I see the output from make – both the
commands and the error messages?

The following are the makefile and the makefile output. I have got to
the point now where most things are found except that I get “undefined
reference PxLoadImage”. As you can see I have even forced the necessary
library.

cc -g -Wc,-O3 -fomit-frame-pointer -Wl,-O3 -fomit-frame-pointer
-l Ap -l phexlib -l /x86/usr/lib/libphexlib.a -l ph -l phrender
-Bdynamic -l m abmain.o base_focus.o base_setup.o exit_app.o filesel_open.o
filesel_setup.o initialize.o screen.o -M
-o slideshow -o Phmem
screen.o: In function screen_read': screen.o(.text+0x66f): undefined reference to PxLoadImage’
cc: /usr/bin/ld error 1
make: *** [shr] Error 1

The RTP linker processes libraries and object files in the specified
order and never goes back. Your makefile needs to specify object files
before libraries.

This makefile feels really old – it looks like a Photon 1.0 style
application. My guess is that PhAB had a problem converting this app
into a proper Photon 2 application.

When you open the app in PhAB, is “Convert to Multiplatform” in the
Application menu enabled? If it is, could you select it asd see what
happens?

Also I see that phappbind has been replaced with phabbind. phabbind
seems to expect a directory structure that doesnt match the one that I
have. I get the feeling that slideshow was hand written a long time ago.

Yes, the new “multiplatform” directory structure was introduced quite a
while ago – in Photon 1.13, I think.

Its becomming a better learning exercise than I expected…

It would have been easier if you picked an app that was created with
Photon 1.14. That’s what we test most…

\

Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Wojteck:

“Convert to Multiplatform” - That was it… All ok now. I reloaded the
original source (started again), then did the convert. There were a few
minor changes, mostly to do with function returns.

It shares a problem with the image viewer, in that it wont display an
image in Phindows. And it seems to have changed the palette for the
desktop display. Other than those things - all is great.

Thanks for the help…
Andy.


Wojtek Lerch wrote:

Andy Rhind <> camerons_act@bigpond.com> > wrote:
Wojtek Lerch wrote:
Andy Rhind <> camerons_act@bigpond.com> > wrote:

PxLoadImage,
PxLoadGIF.

These two should be in a library called “libphexlib.a”. Does your
Makefile tell the linker to use that library? (Before you ask: yes, it
should do that by default.) Could I see the output from make – both the
commands and the error messages?

The following are the makefile and the makefile output. I have got to
the point now where most things are found except that I get “undefined
reference PxLoadImage”. As you can see I have even forced the necessary
library.

cc -g -Wc,-O3 -fomit-frame-pointer -Wl,-O3 -fomit-frame-pointer
-l Ap -l phexlib -l /x86/usr/lib/libphexlib.a -l ph -l phrender
-Bdynamic -l m abmain.o base_focus.o base_setup.o exit_app.o filesel_open.o
filesel_setup.o initialize.o screen.o -M
-o slideshow -o Phmem
screen.o: In function screen_read': screen.o(.text+0x66f): undefined reference to PxLoadImage’
cc: /usr/bin/ld error 1
make: *** [shr] Error 1

The RTP linker processes libraries and object files in the specified
order and never goes back. Your makefile needs to specify object files
before libraries.

This makefile feels really old – it looks like a Photon 1.0 style
application. My guess is that PhAB had a problem converting this app
into a proper Photon 2 application.

When you open the app in PhAB, is “Convert to Multiplatform” in the
Application menu enabled? If it is, could you select it asd see what
happens?

Also I see that phappbind has been replaced with phabbind. phabbind
seems to expect a directory structure that doesnt match the one that I
have. I get the feeling that slideshow was hand written a long time ago.

Yes, the new “multiplatform” directory structure was introduced quite a
while ago – in Photon 1.13, I think.

Its becomming a better learning exercise than I expected…

It would have been easier if you picked an app that was created with
Photon 1.14. That’s what we test most…


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.


NOTE- New phone,fax numbers

Andy Rhind
Symmetry Innovations Pty Ltd.
PO Box 3204
Weston
A.C.T 2611,
Australia
E-Mail: andy@symmetry.com.au
Phone: 61-2-6248 6611
Fax : 61-2-6248 8383

In article <39FE362D.C83A8EA1@bigpond.com>,
Andy Rhind <andy@symmetry.com.au> wrote:

Wojteck:

“Convert to Multiplatform” - That was it… All ok now. I reloaded the
original source (started again), then did the convert. There were a few
minor changes, mostly to do with function returns.

It shares a problem with the image viewer, in that it wont display an
image in Phindows. And it seems to have changed the palette for the

Shared memory images are not sent by phrelay unless they
have a CRC tag…

desktop display. Other than those things - all is great.

Thanks for the help…
Andy.

[snip]

\

Garry Turcotte (R&D)
QNX Software Systems, Ltd.