Error with PtNumericFloat

Hi,

Using Ph app builder and a PtNumericFloat widget, I receive the
following compile error:
abmain.o(.rodata+0x1dc): undefined reference to ‘PtNumericFloat’

What library should I have linked? Why didn’t appbuilder include it in
my makefile?

Alec Gorjestani

Alec Gorjestani,ME 357,625-4817, <alecg@me.umn.edu> wrote:

Using Ph app builder and a PtNumericFloat widget, I receive the
following compile error:
abmain.o(.rodata+0x1dc): undefined reference to ‘PtNumericFloat’

What library should I have linked? Why didn’t appbuilder include it in
my makefile?

The problem with PtNumericFloat is that it’s in libph.a but not in
libph.so. Here’s how the docs explain it:

PtNumericFloat isn’t included in the shared ph library because it
uses floating-point operations. If you use it in a non-PhAB
application, link with the static library. For more information,
see Compiling and linking a non-PhAB application in the Programming
Photon without PhAB chapter of the Photon Programmer’s Guide.

What the docs do not mention is that PhAB does not handle this
automatically… The workaround is to append

-Bstatic -lph -Bdynamic

to your SDFLAGS after the PhAB-generated list of libraries.

Someone else will have to confirm whether this hack is going to stay or
is it just a temporary situation that will some day get fixed…


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