I'm running into a linker issue when moving code that builds on RHEL 6 to
Fedora or RHEL 7. Here's a simple reproducer:

Download simple.c from
https://github.com/markkilgard/glut/blob/master/progs/examples/simple.c and
then run:
g++ simple.c -lglut -o simple

On RHEL 7, I get this error:
~> g++ simple.c -lglut -o simple
/usr/bin/ld: /tmp/ccPIpRiP.o: undefined reference to symbol 'glOrtho'
/usr/bin/ld: note: 'glOrtho' is defined in DSO /lib64/libGL.so.1 so try
adding it to the linker command line
/lib64/libGL.so.1: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

On Fedora 22, I get this error (which is basically the same):
~> g++ simple.c -lglut -o simple
/usr/bin/ld: /tmp/ccqKG2Fe.o: undefined reference to symbol 'glVertex2i'
/usr/lib64/nvidia/libGL.so.1: error adding symbols: DSO missing from
command line
collect2: error: ld returned 1 exit status

The issue appears to be that the linker would resolve symbols that were in
the linked to library on RHEL 6, but aren't doing that in Fedora and RHEL
7. Any ideas on what's going on and how I can fix it without explicitly
adding the second level libraries in my build command?

Thanks,
Dave
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org

Reply via email to