VS2010 - Cannot open include file: 'unistd.h'

Problems building or running the engine, queries about how to use features etc.
Post Reply
alforno
Gnoblar
Posts: 3
Joined: Sun Mar 31, 2013 9:50 pm

VS2010 - Cannot open include file: 'unistd.h'

Post by alforno »

With Visual Studio 2010, I'm trying to build Ogre from source (Mercurial) and have run into compile error.

Code: Select all

1>------ Build started: Project: OgreMain, Configuration: Release Win32 ------
1>  OgreDeflate.cpp
1>d:\src\ogrebuild\dependencies\include\zconf.h(289): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I've used CMake to create the VS2010 solution and project files. Here is the output from Cmake 2.8.10.2 when I press the Configure button.

Code: Select all

Configuring OGRE 2.1.0unstable
Search path: D:/src/ogrebuild/Dependencies;D:/src/ogre/Dependencies;D:/src/ogrebuild/../Dependencies;D:/src/ogre/../Dependencies
Looking for ZLIB...
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Found ZLIB: optimized;D:/src/ogrebuild/dependencies/lib/zlib.lib;debug;D:/src/ogrebuild/dependencies/lib/zlib.lib
Looking for ZZip...
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Could not locate ZZip
Looking for FreeImage...
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Found FreeImage: optimized;D:/src/ogrebuild/dependencies/lib/FreeImage.lib;debug;D:/src/ogrebuild/dependencies/lib/FreeImage.lib
Looking for FREETYPE...
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
CMAKE_PREFIX_PATH: D:/src/ogrebuild/Dependencies;D:/src/ogre/Dependencies;D:/src/ogrebuild/../Dependencies;D:/src/ogre/../Dependencies
CMAKE_PREFIX_PATH: D:/src/ogrebuild/Dependencies;D:/src/ogre/Dependencies;D:/src/ogrebuild/../Dependencies;D:/src/ogre/../Dependencies
Found FREETYPE: optimized;D:/src/ogrebuild/dependencies/lib/freetype.lib;debug;D:/src/ogrebuild/dependencies/lib/freetype.lib
Looking for DirectX9...
Found DirectX9: C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86/d3d9.lib
Looking for DirectX11...
Found DirectX11: C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86/d3d11.lib
Looking for Cg...
Cg_PREFIX_PATH changed.
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Could not locate Cg
Looking for POCO...
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Could not locate POCO
Looking for TBB...
Could not locate TBB
Looking for GLSL_Optimizer...
GLSL_Optimizer_PREFIX_PATH changed.
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Could not locate GLSL_Optimizer
Looking for HLSL2GLSL...
HLSL2GLSL_PREFIX_PATH changed.
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Could not locate HLSL2GLSL
Looking for OIS...
OIS_PREFIX_PATH changed.
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Could not locate OIS
Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
Looking for Softimage...
Could not locate Softimage
Looking for CppUnit...
Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE) 
Could not locate CppUnit

-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ zlib
+ freeimage
+ freetype
+ OpenGL
+ OpenGL 3+
+ OpenGL ES 1.x
+ OpenGL ES 2.x
+ OpenGL ES 3.x
+ DirectX9
+ DirectX11
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ zziplib: Extract data from zip archives <http://zziplib.sourceforge.net>
+ cg: C for graphics shader language <http://developer.nvidia.com/object/cg_toolkit.html>
+ boost: Boost (general) <http://boost.org>
+ boost-thread: Used for threading support <http://boost.org>
+ boost-date_time: Used for threading support <http://boost.org>
+ POCO: POCO framework <http://pocoproject.org/>
+ tbb: Threading Building Blocks <http://www.threadingbuildingblocks.org/>
+ GLSL Optimizer: GLSL Optimizer <http://github.com/aras-p/glsl-optimizer/>
+ HLSL2GLSL: HLSL2GLSL <http://hlsl2glslfork.googlecode.com/>
+ OIS: Input library needed for the samples <http://sourceforge.net/projects/wgois>
+ Doxygen: Tool for building API documentation <http://doxygen.org>
+ Softimage: Softimage SDK needed for building XSIExporter <FALSE>
+ CppUnit: Library for performing unit tests <http://cppunit.sourceforge.net>
-----------------------------------------------------------------------------

send_errorD:/src/bin/debug/OIS_d.dll did not exist, can't install!
send_errorD:/src/bin/release/OIS.dll did not exist, can't install!
Could not find dependency: OIS
Skipping samples build

----------------------------------------------------------------------------
  FEATURE SUMMARY
----------------------------------------------------------------------------

Building components:
  + Paging
  + Terrain
  + RTShader System
  + RTShader System Core Shaders
  + RTShader System Extensions Shaders
  + Volume
  + Overlay
Building plugins:
  + BSP scene manager
  + Octree scene manager
  + Portal connected zone scene manager
  + Particle FX
Building rendersystems:
  + Direct3D 9
  + Direct3D 11
  + OpenGL
Building executables:
  + Samples
  + Tools
Building core features:
  + DDS image codec
  + FreeImage codec

Build type:                      dynamic
Threading support:               none
Use double precision:            disabled
Allocator type:                  nedmalloc (pooling)
STL containers use allocator:    enabled
Strings use allocator:           disabled
Memory tracker (debug):          disabled
Memory tracker (release):        disabled
Use new script compilers:        
Use Boost:                       disabled

----------------------------------------------------------------------------

Configuring done
I've done an online search and found that unistd.h is not part of VS2010, so how can I get this to build?
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: VS2010 - Cannot open include file: 'unistd.h'

Post by Kojack »

OGRE 2.1.0unstable
Hmm, that looks a bit futuristic. :) We are only up to 1.8.1 stable release, 1.9 and 2.0 dev branches.
Which branch in mercurial did you get? Don't use default or 2.0, they probably aren't in usable form (default isn't updated as often and 2.0 is a long way off). The v1-9 branch is the best one at the moment.
Which dependencies did you get? The error is happening in zconf.h, which is from one of the dependency libraries (zlib or zziplib).
Ogre should build fine without unistd.h.
alforno
Gnoblar
Posts: 3
Joined: Sun Mar 31, 2013 9:50 pm

Re: VS2010 - Cannot open include file: 'unistd.h'

Post by alforno »

Thanks for the reply. I got version 1.81, re-ran CMake and then tried to compile in VS2010. Unfortunately it still isn't building, but at least I got past the unistd.h problem. I'll keep working on it, there is a lot to learn. Thanks again.
Post Reply