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

BUILD FAILING ON UBUNTU #24

Closed
dlgeraghty opened this issue Jun 21, 2020 · 6 comments
Closed

BUILD FAILING ON UBUNTU #24

dlgeraghty opened this issue Jun 21, 2020 · 6 comments

Comments

@dlgeraghty
Copy link

tried to build using the makefile, it failed in ubuntu (maybe I was missing some libs but I doubt that...)
searching in the internet I came to try : gcc dwmblocks.c -lX11 -o dwmblocks which successfully compiled

@torrinfail
Copy link
Owner

I would need the error that make spit out to help with that.

@mendezmariano
Copy link

here it comes:
$ make
cc pkg-config --cflags x11 pkg-config --libs x11 dwmblocks.c -o dwmblocks
/usr/bin/ld: /tmp/ccg6dlqE.o: in function setroot': dwmblocks.c:(.text+0x3b6): undefined reference to XOpenDisplay'
/usr/bin/ld: dwmblocks.c:(.text+0x428): undefined reference to XStoreName' /usr/bin/ld: dwmblocks.c:(.text+0x437): undefined reference to XCloseDisplay'
collect2: error: ld returned 1 exit status

@torrinfail
Copy link
Owner

I have come across this issue on my pinebook pro running debian. I never figured out the root cause myself. The way I got it to work was by using clang (CC=clang make) in the most recent commit. Things to check if you prefer using gcc, check the output of pkg-config --libs x11 by itself, and make sure that cc is linked to gcc properly with ls -l $(which cc). The makefile works on arch, void, alpine, freebsd, and openbsd. So I think it is just an issue with debian distros.

@torrinfail
Copy link
Owner

I merged a change that swapped the order of the cc arguments in the Makefile which should solve this issue.

@thierrybo
Copy link

Hi,

yes but you swap cc arguments order back again in 7e0bc3f, so the issue is always there in Debian.

${CC} dwmblocks.c `pkg-config --cflags x11 --libs x11` -o dwmblocks

just work fine.

Macnolo0x7D4 pushed a commit to Macnolo0x7D4/dwmblocks that referenced this issue Dec 23, 2021
@audrew
Copy link

audrew commented Jun 28, 2022

Hi,

yes but you swap cc arguments order back again in 7e0bc3f, so the issue is always there in Debian.

${CC} dwmblocks.c `pkg-config --cflags x11 --libs x11` -o dwmblocks

just work fine.

Thanks, that worked fine

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