QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Linking to photon_s (shared) |
Ref. No. |
QNX.000009840 |
Category(ies) |
Development |
Issue |
We are trying to link a photon application using shared libraries. We have been using the static libraries without a problem and we are trying to save some space.
Our link line includes:
x09-l Aplib_s -l phrtlib -l phexlib -l phcontrib -l photon_s -l phrender_s
which is what it was before except with _s's on three libs.
What we are getting is an undefined symbol: x09file npmain.o([...]/src/npmain.c): undefined symbol PtAppCallSignalProc_
Question is: why would this symbol be in the static libs, and not in the shared ones? How do we proceed?
|
Solution |
There are some functions which are used so seldom, so it was decided to keep the shared lib small and put those functions in the static lib only.
Add '-l photon' as the last lib in your link line. That way it will pick up anything not found in the shared lib.
The other option:
The code in npmain.c is a PhAB main loop. so, the call to PtAppCallSignalProc() in the main loop is only necessary if you are using the PtAppAddSignalProc() function or the PtTty widget. In case you are not using PtAppAddSignalProc(), you can remove the line that calls PtAppCallSignalProc() from your main loop and then you do not need to add '-l photon' argument. |
|