0

I cannot find any way to add the zip.h (from minzip) header in my C code (using VSCode, Windows 11).

I've added the minizip and zlib folder to includePath, also tried to run the code with -lz in terminal. Am I missing something obvious? im going mad

Edit: Last terminal command I tried was

gcc main.c -o main -I"C:/CodeAux/zlib-1213/contrib/minizip" -L"C:/CodeAux/zlib-1213" -lminizip  -lz

, but I get

C:/Compilers/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lminiunzip: No such file or directory
collect2.exe: error: ld returned 1 exit status

(I get this for every unzip function). I tried -lminiunzip but it is not found:

C:/Compilers/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lminiunzip: No such file or directory
Gerhardh
  • 11,688
  • 4
  • 17
  • 39
Nerfstorm
  • 1
  • 2
  • 2
    Welcome to SO. Are you talking about a compilation error or about a message from VS Code? Changing `IncludePath` only allows VSCode to find headers. It does not affect the compiler. Did you add `tasks.json` accordingly`? What is your exact compilation command? Please add your exact and complete command line and error (as formatted text, not as screenshot) to your question. – Gerhardh May 02 '23 at 05:31
  • Sorry, I've added them now – Nerfstorm May 04 '23 at 04:11
  • Where does the linker get the idea that `lminiunzip` is needed? If `lz` and `lminizip` lead to further dependencies I would expect to get a list of unresolved function references but not for another library. – Gerhardh May 08 '23 at 14:00

0 Answers0