# Mkmf have\_header function on Windows XP

**URL:** <https://www.ruby-forum.com/t/mkmf-have-header-function-on-windows-xp/91323>\
**Category:** Ruby\
**Created:** [April 6, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/mkmf-have-header-function-on-windows-xp/91323 "2007-04-06T19:37:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blakeage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Post date:** [April 6, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/mkmf-have-header-function-on-windows-xp/91323/1 "2007-04-06T19:37:36Z")

</div>

I’m trying to get an extension built on WinXP. It’s the PL/Ruby library  
for writing stored procedures for PostgreSQL.

I’m posting this because it seems like a generic enough question.

I’ve got Ruby 1.8.6. PostgreSQL 8.2

I’m running command:

ruby extconf.rb --with-pgsql-dir=“C:\PostgreSQL\8.2”  
–with-pgsql-dir=“C:\PostgreSQL\8.2\lib” --ruby=“C:\ruby”

And it’s complaining that it can’t find a header file that I know exists  
where it’s looking. The error is:

checking for C:\PostgreSQL\8.2\include\server/catalog/pg\_proc.h… no

I’ve tried all sorts of paths, and have begun digging into extconf.rb,  
but no matter what the path, the have\_header() function always causes  
the above error.

---

<div class="post-metadata">

**Author:** ![blakeage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Post date:** [April 6, 2007, 8:16pm UTC](https://www.ruby-forum.com/t/mkmf-have-header-function-on-windows-xp/91323/2 "2007-04-06T20:16:08Z")

</div>

On Apr 6, 11:37 am, Blake M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –with-pgsql-dir=“C:\PostgreSQL\8.2\lib” --ruby=“C:\ruby”
> 
> And it’s complaining that it can’t find a header file that I know exists  
> where it’s looking. The error is:
> 
> checking for C:\PostgreSQL\8.2\include\server/catalog/pg\_proc.h… no
> 
> I’ve tried all sorts of paths, and have begun digging into extconf.rb,  
> but no matter what the path, the have\_header() function always causes  
> the above error.

You’ve got two “–with-pgsql-dir” directives there. I’m guessing you  
wanted something else for the second one. This worked for me (sort  
of):

C:\rubyVC8\src\plruby-0.5.0\>c:\rubyvc8\bin\ruby extconf.rb --with-  
pgsql-dir=C:\Progra~1\PostgreSQL\8.1  
checking for catalog/pg\_proc.h… yes  
checking for rb\_hash\_delete() in ruby.h… yes  
checking for rb\_block\_call()… no  
checking for server/utils/array.h… yes  
The system cannot find the path specified.  
The filename or extension is too long.  
The filename or extension is too long.  
The filename or extension is too long.  
The filename or extension is too long.  
creating Makefile

However, even if you get past that point, the generated Makefile is  
not compatible with Windows’ nmake. I get this:

C:\rubyVC8\src\plruby-0.5.0\>nmake

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42  
Copyright (C) Microsoft Corporation. All rights reserved.

makefile(40) : fatal error U1001: syntax error : illegal character ‘{’  
in macro  
Stop.

I’ve mentioned this to Guy a long time ago, but he hasn’t fixed it  
yet.

Sorry to be a killjoy. Bug Guy about it. 🙂

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![blakeage](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b38774/32.png) [@blakeage](https://www.ruby-forum.com/u/blakeage)\
**Post date:** [April 6, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/mkmf-have-header-function-on-windows-xp/91323/3 "2007-04-06T20:56:57Z")

</div>

Daniel B. wrote:

> On Apr 6, 11:37 am, Blake M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > –with-pgsql-dir=“C:\PostgreSQL\8.2\lib” --ruby=“C:\ruby”  
> > You’ve got two “–with-pgsql-dir” directives there.  
> > Yes, I fixed that to no avail.

> However, even if you get past that point, the generated Makefile is  
> not compatible with Windows’ nmake. I get this:  
> Figured this was an uphill battle, and I really don’t have time to debug  
> the thing. Would be cool to write procedures in Ruby though.

> I’ve mentioned this to Guy a long time ago, but he hasn’t fixed it  
> yet.  
> Yea, I did today too. He’s not tested it in Windows though. Thanks for  
> the info.
