xdg-open-server icon indicating copy to clipboard operation
xdg-open-server copied to clipboard

can't build on ubuntu 20.04

Open masavini opened this issue 4 years ago • 3 comments

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..?

masavini avatar Dec 05 '20 21:12 masavini

I have the same problem :-(

FriendlyTroll avatar Apr 11 '21 08:04 FriendlyTroll

https://github.com/kitsunyan/xdg-open-server/blob/master/Makefile#L18 -> $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ -lX11 -lpthread

summylight avatar Apr 20 '23 10:04 summylight

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.

summylight avatar Apr 20 '23 10:04 summylight