0

So I have this school folder, where I have to call the file "Test.c" file, where it contains the code to display an image. Calling the file requires me to type "make", which im assuming is from this file called MakeFile in the terminal where it would print.

gcc -std=c99 -g -Wall -O3 pkg-config --cflags x11 -o test test.c imgops.c draw.c png.c -lm -lpng pkg-config --libs x11

but when I have to call the Test file, "./test", it gives me the error

Grey Array: cannot connect to X server '(null)

I'm really new at coding in C and using Ubuntu, but I cannot find an answer to this error. If anyone can help, I'll greatly appreciate it!

EDIT: Also, it should be displaying a new window, with a completely black image

EDIT: I retyped some parts of the details of the problem, and added the code of the test.c where it contains the code for the complete black image. I'm also doing this in Windows Powershell and using Ubuntu within it

  • What kind of Ubuntu system are you trying to run this on? Does it have a GUI desktop or is it a CLI system such as WSL? – steeldriver Feb 25 '20 at 13:15
  • I'm not sure, like I'm using it on my laptop, which has windows 10, and I'm doing it in powershell (where I just access ubuntu from there) – Justin Yan Feb 25 '20 at 22:35
  • You may find that this is relevant: [What's the easiest way to run GUI apps on Windows Subsystem for Linux as of 2018?](https://askubuntu.com/questions/993225/whats-the-easiest-way-to-run-gui-apps-on-windows-subsystem-for-linux-as-of-2018) – steeldriver Feb 26 '20 at 03:00
  • Nope, didn't fix it. I downloaded one of the xservers listed like xming and I still get the same error. I also clarified and added another file that could help. – Justin Yan Mar 02 '20 at 16:47

0 Answers0