OpenGL Performer linking issues [SOLVED]
#1
OpenGL Performer linking issues [SOLVED]
Hello,
For the past couple days, I've been banging my head against a wall trying to figure out why I can't get any OpenGL Performer code to link with ld, and I'm hoping you guys can help. 

I've got IRIX 6.5.22 and Performer 2.2 on my O2. Just trying the sample code (hello.c to be exact), it compiles with cc, but ld doesn't want to link it. Even after telling it to link libpf.so (and the related libraries) it gives me a bunch of unresolved symbol errors on the basic Performer functions like pfInit and pfExit. Here's my whole linker command (I'm using the same library arguments for cc):

Code:
ld -o hello -v lpfdu_ogl -lpfui -lpfutil_ogl -lpf_ogl -limage -lGLU -lGL
-lXext -lXmu -lX11 -lm -lfpe -lmalloc -lC hello.o

Another thing is that with the library I'm assuming a lot of these symbols come from (libpf.so), ld says that it isn't being used to resolve any symbols, and yet it's needed to resolve the symbols it's yelling about, which is odd to me.

I have a feeling my installation needs to get redone, but I'd like a second opinion before I blow it all away Smile

I will provide exact command outputs when I'm free today

Thanks!

Octane Octane (Apollo): R12k @ 400mhz, 768mb RAM, 300GB hard drive, MXE+SE graphics
O2 O2 (Celeste): R5k @ 180mhz, 192MB RAM, 80GB hard drive, AV1 option board
(This post was last modified: 12-05-2022, 04:26 AM by lenix.)
lenix
O2

Trade Count: (0)
Posts: 12
Threads: 4
Joined: Jul 2021
Location: Florida, United States
Find Reply
12-04-2022, 02:55 PM
#2
RE: OpenGL Performer linking issues
IRIX ld is very picky about the order in which libraries are listed.  It scans them in the order they are named on the command line and uses them to resolve any unresolved symbols from prior objects.  It doesn't carry them forward, so to speak, to subsequent objects.  (Unlike, say, GNU ld which doesn't care about order at all.)

So, to me, the glaring mistake is that your hello.o object is listed last.  None of the libraries in your command will be used to resolve symbols in hello.o.  But hello.o will be used to resolve symbols in them (of which there should be none).  So that's backwards.  Put hello.o before all the libraries so that they can be used to satisfy the symbols in hello.o.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
12-05-2022, 01:54 AM
#3
RE: OpenGL Performer linking issues
Yeah, thankfully most software isn't moronic about link order. It's a good practice to use link flags last.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
(This post was last modified: 12-05-2022, 02:29 AM by Raion.)
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,249
Threads: 535
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-05-2022, 02:28 AM
#4
RE: OpenGL Performer linking issues [SOLVED]
(12-05-2022, 01:54 AM)jpstewart Wrote:  IRIX ld is very picky about the order in which libraries are listed.  It scans them in the order they are named on the command line and uses them to resolve any unresolved symbols from prior objects.  It doesn't carry them forward, so to speak, to subsequent objects.  (Unlike, say, GNU ld which doesn't care about order at all.)

So, to me, the glaring mistake is that your hello.o object is listed last.  None of the libraries in your command will be used to resolve symbols in hello.o.  But hello.o will be used to resolve symbols in them (of which there should be none).  So that's backwards.  Put hello.o before all the libraries so that they can be used to satisfy the symbols in hello.o.

Yep, that was the issue. So annoying, but now I can get to real OpenGL programming. Also, definitely putting library flags at the end from now on no matter what machine I program on :)

Thanks to both of you!

Octane Octane (Apollo): R12k @ 400mhz, 768mb RAM, 300GB hard drive, MXE+SE graphics
O2 O2 (Celeste): R5k @ 180mhz, 192MB RAM, 80GB hard drive, AV1 option board
(This post was last modified: 12-05-2022, 04:27 AM by lenix.)
lenix
O2

Trade Count: (0)
Posts: 12
Threads: 4
Joined: Jul 2021
Location: Florida, United States
Find Reply
12-05-2022, 04:25 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)