xdg-open-server
xdg-open-server copied to clipboard
can't build on ubuntu 20.04
hi, here is make output:
$ make
gcc -lX11 -lpthread main.c -o xdg-open-server
main.c: In function ‘main’:
main.c:71:3: warning: missing sentinel in function call [-Wformat=]
71 | execlp("mkdir", "mkdir", "-p", socket_dir, 0);
| ^~~~~~
main.c:91:19: warning: too many arguments for format [-Wformat-extra-args]
91 | fprintf(stderr, "Can not find display variable.\n", socket_dir);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccskY9XR.o: in function `main':
main.c:(.text+0x426): undefined reference to `XOpenDisplay'
/usr/bin/ld: main.c:(.text+0x52f): undefined reference to `pthread_create'
/usr/bin/ld: main.c:(.text+0x566): undefined reference to `XSetIOErrorHandler'
/usr/bin/ld: main.c:(.text+0x57f): undefined reference to `XNextEvent'
collect2: error: ld returned 1 exit status
make: *** [Makefile:18: xdg-open-server] Error 1
hints..?
I have the same problem :-(
https://github.com/kitsunyan/xdg-open-server/blob/master/Makefile#L18
-> $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ -lX11 -lpthread
And docker command shoule be:
docker run --name my_container \
-v "${XDG_RUNTIME_DIR}/xdg-open-server:${XDG_RUNTIME_DIR}/xdg-open-server:ro" \
-v /usr/local/lib/xdg-open-server/xdg-open:/usr/bin/xdg-open:ro \
-v /bin/socat:/bin/socat \
my_image
Please start a new terminal and run /usr/local/bin/xdg-open-server before running docker command to init ${XDG_RUNTIME_DIR}/xdg-open-server.