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

Can't open X display #37

Open
LucasMW opened this issue Jun 3, 2024 · 1 comment
Open

Can't open X display #37

LucasMW opened this issue Jun 3, 2024 · 1 comment

Comments

@LucasMW
Copy link

LucasMW commented Jun 3, 2024

time make

cc -Os -std=c99 -pedantic -Wall -Wextra -Wconversion   -c -o schrift.o schrift.c
ar rc libschrift.a schrift.o
ranlib libschrift.a
cc -c -g -Os -std=c99 -pedantic -Wall -Wextra demo.c -o demo.o -I./ -I/usr/include/X11
demo.c:53:9: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int main()
        ^
         void
1 warning generated.
cc -g -Os demo.o -o demo -L/usr/lib/X11 -L. -lX11 -lXrender -lschrift -lm
ld: warning: search path '/usr/lib/X11' not found
cc -c -g -Os -std=c99 -pedantic -Wall -Wextra stress.c -o stress.o -I./
cc -g -Os stress.o -o stress -L. -lschrift -lm
make  0,66s user 0,42s system 9% cpu 11,749 total

./demo

Can't open X display

Mac OS Sonoma

@marler8997
Copy link
Contributor

marler8997 commented Jun 3, 2024

Ooof, you've ran into an issue with your X connection and unfortunately libX11 doesn't implement any error handling to tell you what went wrong. In fact I gave a talk that goes into this: https://www.youtube.com/watch?v=aPWFLkHRIAQ&t=730s

You could try checking your DISPLAY environment variable, try other x applications xeyes?, If you want to download the zig compiler you could try running one of my x11 examples in https://github.com/marler8997/zigx (download zig 0.12.0 and run zig run example.zig), and it should give you a nice error message that tells you exactly what's wrong with your X11 setup.

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