Please I need help when I try to compile my .C to png
gcc --std=c99 -Wall -lz a.c -o a.png
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lz
collect2.exe: error: ld returned 1 exit status
What does this mean?
From the error message, the linker says that it can not find libz.so
or libz.a
.
If you are providing that lib from your own path,
tell the linker that it has to search in your path, by
gcc --std=c99 -Wall -Ldir -lz a.c -o a.png
use
ld -lz --verbose
to see where linker has searched for libz.