You should install the development support files for zlib, try:
sudo apt-get install libz-dev
Other package names: zlib1g-dev.
If you've already zlib library, make sure you're compiling your code sources with -lz. See: missing zlib.h in ubuntu.
You should install the development support files for zlib, try:
sudo apt-get install libz-dev
Other package names: zlib1g-dev.
If you've already zlib library, make sure you're compiling your code sources with -lz. See: missing zlib.h in ubuntu.
Install zlib from it's source, solve my similar error. Download last version from this then:
configure
make -j4
make install
C1083: Cannot open include file: 'zlib.h': No such file or directory
zlib.h: No such file or directory
./bitmap/../base/zlib_util_c.h:2:18: fatal error: zlib.h: No such file or directory
go - robotgo for windows 10 - fatal error: zlib.h: No such file or directory - Stack Overflow
I try this one below and worked for me
https://github.com/lowkey42/MagnumOpus/wiki/TDM-GCC-Mingw64-Installation#zlib-x64
download ZLIB x64 from this link
copy _\zlib\bin to \TDM\bin
copy _\zlib\bin to \Git\bin
copy \zlib\include to \TDM\include
copy \zlib\lib to \TDM\lib
Solution 1: ignore bitmap.go
Your code doesn't use bitmap so you don't need to compile this file, and then you will not encounter this error.
put //go:build ignore to bitmap.go
//go:build ignore // 👈
// ...
//#include "screen/goScreen.h"
#include "bitmap/goBitmap.h"
*/
import "C"
import (
"unsafe"
"github.com/vcaesar/tt"
)
// ...
Solution2: install MinGW-W64.{gcc, g++}
go to sourceforge to download MinGW-W64 GCC
Select what you want
- version:{...,
8.1.0,7.3.0,6.4.0,5.4.0, ...} - arch. :
x86_64, i686similarlyx86 - threads:
posix,win32 - exception:
sjlj,dwarf,seh

I select x86_64-win32-seh8.1.0
and then
unzip the file.
copy the path: for example
C:\downloads\x86_64-8.1.0-release-win32-seh-rt_v6-rev0\mingw64\bin(which contains:gcc.exe,g++.exe)set go env:
CC,CXXgo env -w CC=C:\downloads\x86_64-8.1.0-release-win32-seh-rt_v6-rev0\mingw64\bin\gccgo env -w CXX=C:\downloads\x86_64-8.1.0-release-win32-seh-rt_v6-rev0\mingw64\bin\g++
Finally, try to go build again. It should work.
- See more issues of build errors: robotgo/issues/100
I have just come about this same problem and wanted to post my solution since I have found so much conflicting documentation on the subject.
The folder containing the dlib folder as well as the libpng, libjpeg, and zlib folders from dlib/external need to be added to the additional include directories list in the solution settings.
dlib/all/source.cpp as well as the source files for libpng, libjpeg, and zlib also need to be added to the project.
Note that CBLAS should not be added to the project in any way, because it needs Fortran to compile, and it is very difficult to get this to compile from Visual Studio.
Finally, make sure to add DLIB_PNG_SUPPORT and DLIB_JPEG_SUPPORT as preprocessor defines in the project settings.
I also attempted to use a cmake generated solution, however, for some reason it had trouble with png support.
It is probably easiest to use CMake to configure your project which uses dlib. It avoids setting all those paths manually. During CMake configure step you can disable usage of libraries like zlib which you don't have/want/need. Here is an example CMakeLists.txt which works for me:
cmake_minimum_required(VERSION 2.6)
PROJECT(DatasetClassifier CXX C)
set(dlib_DIR "" CACHE PATH "Path to dlib") # http://dlib.net/
include(${dlib_DIR}/dlib/cmake)
ADD_EXECUTABLE(DatasetClassifier DatasetClassifier.cpp)
TARGET_LINK_LIBRARIES(DatasetClassifier ${dlib_LIBRARIES})