PgGetVideoModeInfo() & PGGetVideoMode()

Hello,

PgGetVideoModeInfo() & PGGetVideoMode() are both documented but seems to
be missed from the include files and, more important, from the library.

Did I missed something ???

Henri Michelon Henri.Michelon@iiriam.fr

http://nmo-sdk.sourceforge.net/ The Universal SDK.

Yes they were missed from the prototypes, (should be fixed in an upcoming patch), but they are in libph.so

Maybe you’ve spelled them wrong (PgGetVideoMode() instead of PGGetVideoMode())


Henri Michelon <michelon@iiriam.fr> wrote:

Hello,

PgGetVideoModeInfo() & PGGetVideoMode() are both documented but seems to
be missed from the include files and, more important, from the library.

Did I missed something ???

Henri Michelon > Henri.Michelon@iiriam.fr

http://nmo-sdk.sourceforge.net/ > The Universal SDK.

David Rempel wrote:

Yes they were missed from the prototypes, (should be fixed in an upcoming patch), but they are in libph.so

Maybe you’ve spelled them wrong (PgGetVideoMode() instead of PGGetVideoMode())

My professor tell me: use the doc, luke
(http://support.qnx.com/support/docs/photon20/lib_ref/pg/pggetvideomode.html)
btw, I will try PGGetVideoMode().

Please ignore my second post about this problem.

Thanks.

Henri Michelon Henri.Michelon@iiriam.fr

http://nmo-sdk.sourceforge.net/ The Universal SDK.

Henri Michelon <michelon@iiriam.fr> wrote:

No it is PgGetVideoMode…you spelt it PGGetVideoMode in both the
message subject, and in the message again so I thought maybe you had
spelt it wrong in your code as well :wink:

I think you were getting bitten by C++ caring about prototypes whereas straight
C isn’t so strict.

David Rempel wrote:

Yes they were missed from the prototypes, (should be fixed in an upcoming patch), but they are in libph.so

Maybe you’ve spelled them wrong (PgGetVideoMode() instead of PGGetVideoMode())


My professor tell me: use the doc, luke
(> http://support.qnx.com/support/docs/photon20/lib_ref/pg/pggetvideomode.html> )
btw, I will try PGGetVideoMode().

Please ignore my second post about this problem.

Thanks.

Henri Michelon > Henri.Michelon@iiriam.fr

http://nmo-sdk.sourceforge.net/ > The Universal SDK.

David Rempel wrote:

Henri Michelon <> michelon@iiriam.fr> > wrote:

No it is PgGetVideoMode…you spelt it PGGetVideoMode in both the
message subject, and in the message again so I thought maybe you had
spelt it wrong in your code as well > :wink:

I think you were getting bitten by C++ caring about prototypes whereas straight
C isn’t so strict.

Sorry for the mistake.
I try to declare both functions in my program, and link it with ‘-lph
-lphrender’. It fails, both symbols are undefined.
I notice that there is two libraries: libph.a & libph.so. Generally only
one is needed, so what is the differences between them ?

Henri Michelon Henri.Michelon@iiriam.fr

http://nmo-sdk.sourceforge.net/ The Universal SDK.

Henri Michelon <michelon@iiriam.fr> wrote:


David Rempel wrote:

Henri Michelon <> michelon@iiriam.fr> > wrote:

No it is PgGetVideoMode…you spelt it PGGetVideoMode in both the
message subject, and in the message again so I thought maybe you had
spelt it wrong in your code as well > :wink:

I think you were getting bitten by C++ caring about prototypes whereas straight
C isn’t so strict.


Sorry for the mistake.
I try to declare both functions in my program, and link it with ‘-lph
-lphrender’. It fails, both symbols are undefined.
What do you see if you type

“strings /usr/photon/lib/libph.so.1 | grep PgGetVideoMode”.

Can you post the command used to link the program?

I notice that there is two libraries: libph.a & libph.so. Generally only
one is needed, so what is the differences between them ?

One is a shared library, the other is static. You should use the
shared lib, so you get smaller executables, which will benefit from
any fixes made to the library without needing to be rebuilt.

Henri Michelon > Henri.Michelon@iiriam.fr

http://nmo-sdk.sourceforge.net/ > The Universal SDK.

Henri Michelon <michelon@iiriam.fr> wrote:


David Rempel wrote:

Henri Michelon <> michelon@iiriam.fr> > wrote:

No it is PgGetVideoMode…you spelt it PGGetVideoMode in both the
message subject, and in the message again so I thought maybe you had
spelt it wrong in your code as well > :wink:

I think you were getting bitten by C++ caring about prototypes whereas straight
C isn’t so strict.


Sorry for the mistake.
I try to declare both functions in my program,

Did you declare them as extern C functions?

ie:

#ifdef __cplusplus
extern “C” {
#endif

int PgGetVideoMode (PgDisplaySettings_t *settings);
// any other ones needed

#ifdef __cplusplus
};
#endif

and link it with ‘-lph
-lphrender’. It fails, both symbols are undefined.

I assure you they are in the lib. Columns wouldn’t run if they weren’t.

I notice that there is two libraries: libph.a & libph.so. Generally only
one is needed, so what is the differences between them ?

libph.a is the static library, and libph.so is the shared library. In most cases you
want to use the shared version of the lib.

Dave Rempel

David Rempel wrote:

Did you declare them as extern C functions?

ie:

#ifdef __cplusplus
extern “C” {
#endif

int PgGetVideoMode (PgDisplaySettings_t *settings);
// any other ones needed

#ifdef __cplusplus
};
#endif

Ooops, I’m stupid ! Of course this is the problem.

I notice that there is two libraries: libph.a & libph.so. Generally only
one is needed, so what is the differences between them ?

libph.a is the static library, and libph.so is the shared library. In most cases you
want to use the shared version of the lib.

Dave Rempel

I known that, but how I tell GCC: use the shared library, not the static
one. Is it an automatic process, or did I have to use -Bdynamic (I have
tryed, but it said that -Bdynamic is never used, so I assume this is the
default mode) ?

\

Henri Michelon Henri.Michelon@iiriam.fr

http://nmo-sdk.sourceforge.net/ The Universal SDK.

Henri Michelon <michelon@iiriam.fr> wrote:


David Rempel wrote:

Did you declare them as extern C functions?

ie:

#ifdef __cplusplus
extern “C” {
#endif

int PgGetVideoMode (PgDisplaySettings_t *settings);
// any other ones needed

#ifdef __cplusplus
};
#endif


Ooops, I’m stupid ! Of course this is the problem.

:stuck_out_tongue_winking_eye:

I notice that there is two libraries: libph.a & libph.so. Generally only
one is needed, so what is the differences between them ?

libph.a is the static library, and libph.so is the shared library. In most cases you
want to use the shared version of the lib.

Dave Rempel

I known that, but how I tell GCC: use the shared library, not the static
one. Is it an automatic process, or did I have to use -Bdynamic (I have
tryed, but it said that -Bdynamic is never used, so I assume this is the
default mode) ?

By default the linker will look for a shared library first to link against,
and failing that will look for a static version to link in.

Dave Rempel