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

libX11 not added to linking command fails the build #119

Closed
landryb opened this issue Mar 22, 2021 · 4 comments
Closed

libX11 not added to linking command fails the build #119

landryb opened this issue Mar 22, 2021 · 4 comments

Comments

@landryb
Copy link

landryb commented Mar 22, 2021

code added in 6d3b09b checks for XSetErrorHandler which is present in libX11 but it's not added to the linker libs list, so linking fails:

-O2 -pipe  -L/usr/local/lib -o viking main.o icons/libicons.a libviking.a -L/usr/local/lib -pthread -lgthread-2.0 -lgdk_pixbuf-2.0 -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl -L/usr/local/lib -Wl,-rpath-link,/usr/X11R6/lib -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl  -lexpat -L/usr/local/lib -lcurl  -lnettle -lsqlite3 -lmagic -lbz2 -lgps -lgexiv2 -lgeoclue-2 -lz -lm 
ld: error: undefined symbol: XSetErrorHandler
>>> referenced by logging.c:168
>>>               logging.o:(a_logging_init) in archive libviking.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)

@landryb
Copy link
Author

landryb commented Mar 22, 2021

from my understanding there are two checks, first for X11.h, then for XSetErrorHandler in libX11.

on OpenBSD for some reason the first check succeeds but the second fails, but the code using XSetErrorHandler is within HAVE_X11_XLIB_H so enabled..

@landryb
Copy link
Author

landryb commented Mar 22, 2021

i have it working with env vars to make sure the two checks succeeds, but for correctness the usage of XSetErrorHandler should be within HAVE_LIBX11 ?

@rnorris
Copy link
Collaborator

rnorris commented Mar 22, 2021

NB In commit: 6d3b09b it was merely shifting the code around from file main.c --> logging.c
So the original changes date back to 2012 -> commits: fa3eb9d + 5cd09d5

However agreed that XSetErrorHandler should be within HAVE_LIBX11

@landryb Can you confirm if using HAVE_LIBX11 around XSetErrorHandler that it builds correctly without the env var workaround?

@landryb
Copy link
Author

landryb commented Mar 23, 2021

well yes, it does build and is more logical...

rnorris added a commit that referenced this issue Mar 28, 2021
@rnorris rnorris closed this as completed Mar 28, 2021
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

2 participants