Operating System - Linux
1758301 Members
2341 Online
108868 Solutions
New Discussion юеВ

Re: OpenGL / X11 build issues

 
Elliott Brady
New Member

OpenGL / X11 build issues

Hi all,

I've recently built an OpenGL application (using the Qt library) on an HP-UX 11v1 system; it compiles & links fine, but when I try to run it, I get the following error:

/usr/lib/dld.sl: Unresolved symbol: XHPSetErrorHandler (code) from /opt/graphics/OpenGL/lib/libHpGL.2

My Qt library required X11R6 be installed on the machine, where only X11R5 was present.. long story short, the machine now has a (possibly bizarre) hybrid of X11R5 and X11R6 libraries installed which might be the source of my dilemma.

As far as I can tell, the prototype of XHPSetErrorHandler changed between X11R5 and X11R6 [ XHPSetErrorHandler() to XHPSetErrorHandler(Display*, int*) ]- my question is this: Is this error caused because my OpenGL installation was built against X11R5, and due to the function change, the function libHpGL is looking for has changed? Or is it likely to be an issue from my mixing-n-matching of R5/R6 libraries/headers?

nm -n indicates that From what I can tell XHPSetErrorHandler (arguments unknown) is present in libX11 in my X11R6/includes directory...

Just incase it helps, my convoluted link stage is:

aCC -AA +DAportable -Wl,+s -O -Wl,+b,/usr/local/Trolltech/Qt-4.1.4/lib -Wl,+b,/usr/local/Trolltech/Qt-4.1.4/lib -o hellogl .obj/release-st
atic/glwidget.o .obj/release-static/main.o .obj/release-static/window.o .obj/release-static/moc_glwidget.o .obj/release-static/moc_window.o -L/home/ebrady/QT/qt-x11-commercial-src-4.1.4/lib -L/opt/graphics/OpenGL/lib -L/usr/contrib/X11R6/lib -lQtOpenGL -L/home/ebrady/QT/qt-x11-commerc
ial-src-4.1.4/lib -L/opt/graphics/OpenGL/lib -L/usr/contrib/X11R6/lib -L/usr/lib/X11R6 -lQtGui -lSM -lICE -lXi -lXext -lQtCore -lm -ldld -lGLU -lG
L -lXt -lpthread -L/usr/contrib/X11R6/lib/ -lXmu -lXt -L/usr/lib/X11R6 -lX11 -lm

(This completes successfully, and probably isn't going to be too much help unless there's something obvious I've forgotten to link in?)
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: OpenGL / X11 build issues

The name XHPSetErrorHandler isn't mangled so it doesn't know what the arguments are.

>Or is it likely to be an issue from my mixing-n-matching of R5/R6 libraries/headers?

More like that function is missing.

>nm -n indicates that From what I can tell XHPSetErrorHandler (arguments unknown) is present in libX11 in my X11R6/ directory...

Then that may work.

You are linking against libpthread. You must compile with -mt.
Elliott Brady
New Member

Re: OpenGL / X11 build issues

Thanks for the info :)

I've eliminated the error by linking in X11 and Xext from R5 first, then R6 (like so:)

/usr/lib/X11R5/libX11.1 /usr/lib/X11R6/libX11.a /usr/lib/X11R5/libXext.0 /usr/lib/X11R6/libXext.2

But now running the compiled program starts to run, then dies with Bus error (core dumped) :-\ Presumably from having X11R5 and X11R6 mixed badly together...

What's the library symbol precident in aCC? Redefining a symbol you're linking in will overwrite the previous one, right? Is linking these 2 overlapping versions together a very, very bad idea? (Beyond just a messy one).
Elliott Brady
New Member

Re: OpenGL / X11 build issues

Supplimental questions:

Question 1:

Am I correct in assuming that an installation of HPs OpenGL on HP-UX is X11-version-dependent? And therefore I am required to link against X11R5 since /opt/graphics/OpenGL/lib/libHpGL.2 seems to be expecting it?

Question 2: (stupid question)

Does an update *exist* for the stock HP OpenGL implimentation that is built against X11R6? I've looked at a lot of update packages available, and tried to understand the different architectures/platforms as best I can, but unfortunately HP-UX isn't my strongest area..

Thanks again.
Dennis Handly
Acclaimed Contributor

Re: OpenGL / X11 build issues

>What's the library symbol precedent in aC++?

This has nothing to do with aC++. This is a dld issue.

>Redefining a symbol you're linking in will overwrite the previous one, right?

No, the first one in binding order is used.

>Is linking these 2 overlapping versions together a very, very bad idea?

Yes. Especially if the symbols don't overlap exactly.

I don't have an answer to your other two questions.

>And therefore I am required to link against X11R5 since /opt/graphics/OpenGL/lib/libHpGL.2

Seem to require libgrm.2