Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implicit linking to libX11 #15

Closed
cwickert opened this issue Dec 9, 2011 · 5 comments
Closed

implicit linking to libX11 #15

cwickert opened this issue Dec 9, 2011 · 5 comments

Comments

@cwickert
Copy link

cwickert commented Dec 9, 2011

pnmixer uses XKeycodeToKeysym from libX11, but libX11 is not linked explicitly. Thus the build will fail on various distributions such as Fedora >= 13:

gcc -O2 -export-dynamic -o pnmixer support.o main.o hotkeys.o alsa.o callbacks.o prefs.o -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpng12 -lm -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lasound
/usr/bin/ld: hotkeys.o: undefined reference to symbol 'XKeycodeToKeysym'
/usr/bin/ld: note: 'XKeycodeToKeysym' is defined in DSO /usr/lib64/libX11.so.6 so try adding it to the linker command line
/usr/lib64/libX11.so.6: could not read symbols: Invalid operation

For the background of this change, see http://fedoraproject.org/wiki/UnderstandingDSOLinkChange

@nicklan
Copy link
Owner

nicklan commented Dec 13, 2011

Indeed (this was true of libm as well). I've updated configure.in to explicitly check for those libraries and add their linker flags.

Thanks for the report!

@nicklan nicklan closed this as completed Dec 13, 2011
@Viomi
Copy link

Viomi commented Feb 11, 2015

Reviving this from the dead because:

/usr/bin/ld: hotkeys.o: undefined reference to symbol 'XKeycodeToKeysym'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:357: recipe for target 'pnmixer' failed
make[2]: *** [pnmixer] Error 1
make[2]: Leaving directory '/home/user/downloads/pnmixer-0.5/src'
Makefile:449: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/user/downloads/pnmixer-0.5'
Makefile:347: recipe for target 'all' failed
make: *** [all] Error 2

Having this problem again. Was the change done to fix this problem removed?
Running debian sid.

@hasufell
Copy link
Collaborator

@sistematico
Copy link

lucas@caos:~/apps/pnmixer-0.5$ make
make  all-recursive
make[1]: Entering directory '/home/lucas/apps/pnmixer-0.5'
Making all in src
make[2]: Entering directory '/home/lucas/apps/pnmixer-0.5/src'
gcc -O2 -export-dynamic    -o pnmixer support.o main.o hotkeys.o alsa.o callbacks.o prefs.o -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lasound   
/usr/bin/ld: hotkeys.o: undefined reference to symbol 'XKeycodeToKeysym'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:357: recipe for target 'pnmixer' failed
make[2]: *** [pnmixer] Error 1
make[2]: Leaving directory '/home/lucas/apps/pnmixer-0.5/src'
Makefile:449: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/lucas/apps/pnmixer-0.5'
Makefile:347: recipe for target 'all' failed
make: *** [all] Error 2

lucas@caos:~/apps/pnmixer-0.5$ uname -a
Linux caos 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt7-1 (2015-03-01) x86_64 GNU/Linux

lucas@caos:~/apps/pnmixer-0.5$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.0 (jessie)
Release:    8.0
Codename:   jessie

No clue...

@hasufell
Copy link
Collaborator

hasufell commented Apr 4, 2015

@sistematico 0.5 is several years old, use latest git HEAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants