# Compiling ruby.h with precompiled headers

**URL:** <https://www.ruby-forum.com/t/compiling-ruby-h-with-precompiled-headers/175360>\
**Category:** Ruby\
**Created:** [September 11, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/compiling-ruby-h-with-precompiled-headers/175360 "2009-09-11T19:46:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geotavros](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/bcef8e/32.png) [@geotavros](https://www.ruby-forum.com/u/geotavros)\
**Post date:** [September 11, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/compiling-ruby-h-with-precompiled-headers/175360/1 "2009-09-11T19:46:10Z")

</div>

Hi,  
I’m trying to use Ruby in my C++ project. My project uses precompiled  
headers, but when I try to include ruby.h header in it I get errors in  
win32.h files that lie in RUBY\_INCLUDE folder. Here is error:  
…ruby\lib\ruby\1.8\i386-mswin32\win32\win32.h(172) : error C2061:  
syntax error : identifier ‘fd\_set’  
ruby\lib\ruby\1.8\i386-mswin32\win32\win32.h(188) : error C2146: syntax  
error : missing ‘;’ before identifier ‘rb\_w32\_get\_osfhandle’  
ruby\lib\ruby\1.8\i386-mswin32\win32\win32.h(188) : fatal error C1004:  
unexpected end of file found

Is there any way to avoid such error?  
P.S. I’m using MSVC 6, Windows 7 OS  
I’ve tried to create a project without precompiled header and it worked  
fine.
