Click here to Skip to main content
Sign Up to vote bad
good
See more: C++C
After installing libpng and zlib I still have some issues.
When I compile my project I get an error telling me that unistd.h can't be located.
Error	1	fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory	c:\lib\gnuwin32\include\zconf.h	289
So I just commented that line. What effect will this have on my code? and What is the header unistd.h for?
 
Oh by the way,I installed libpng of GnuWin32 because I'm on Windows. Thanx.
Posted 3-Feb-13 0:24am
Edited 3-Feb-13 0:27am


2 solutions

unistd.h defines constants and declares functions for POSIX-compatible operating systems such as Linux or Unix. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html[^]
If your code actually uses functions or constants from unistd.h you need to replace them with Windows equivalents.
  Permalink  
If your build environment is not finding unistd.h then it's likely not set up correctly. To build stuff ported from Linux/Unix which I guess includes libpng in this case you usually need a working MinGW (Minimal GNU on Windows)environment. Although it's possible that the project is designed to build with Visual Studio from the error you're getting it looks unlikely ( Microsoft's Windows headers don't have a unistd.h ).
I can recommend getting a copy of CodeBlocks IDE if you've got the disk space, it comes with a very up to date MinGW GCC, works out of the box on Windows 7 after a simple install and is not a bad IDE at all.
  Permalink  
Comments
Albert Holguin - 4-Feb-13 13:01pm
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 6,959
1 Prasad_Kulkarni 3,689
2 OriginalGriff 3,402
3 _Amy 3,332
4 CPallini 2,950


Advertise | Privacy | Mobile
Web04 | 2.6.130617.1 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid