This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

BUILDING PHP4.2.2 on Windows using supplied .DSW, MS VS C++ 6.0, and Cygwin Headers?

Hi, I've been trying to compile PHP on Windows for days. 

I have had zero success and would appreciate some help/advice from anyone who 
has done it, or from anyone familiar with building Visual C++ projects that 
make use of cygwin headers...?

Following the instructions at:

I have done the following: 

Downloaded cygwin (the latest version, setup is and installed it. At 
first I only installed the default options, but went back and installed the 
entire "Devel" subtree. 

I compiled a simple 'hello world' .c file using gcc to create an 'a.exe'. Just 
for kicks, I include "sys/types.h" and it all works fine under gcc. 

Now, getting back to PHP and Visual Studio and the MSFT compiler: 

I downloaded php-4.2.2.tar.gz from, unpacked it, and located the .DSW 
files in the win32 directory. 

I opened the php4ts.dsw workspace and see there are several projects for the 
php core libs, the test suites, the command line version, and interfaces for 
different webservers (Apache, AOLServer, etc). 

According to the documentation, I add c:\cygwin\usr\include directory to my MS 
Visual Studio's 

Tools->Options:Directories 'Include Directories' 


I try building php4ts_cli project -- a small stub program that will link with 
the core php library and provide a command-line PHP tool. 

It immediately kicks out with: 

c:\cygwin\usr\include\sys/types.h(133) : error C2632: 'long' followed by 'long' 
is illegal
c:\cygwin\usr\include\sys/types.h(135) : error C2632: 'long' followed by 'long' 
is illegal
c:\cygwin\usr\include\sys/types.h(218) : warning C4005: 'FD_SET' : macro 
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winsock.h(83) : 
see previous definition of 'FD_SET'
c:\cygwin\usr\include\sys/types.h(219) : warning C4005: 'FD_CLR' : macro 
        C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\winsock.h(78) : 
see previous definition of 'FD_CLR'
c:\cygwin\usr\include\sys/types.h(220) : warning C4005: 'FD_ISSET' : macro 
[...many more warnings/errors...]

I see that in cygwin sys/types.h uses "long long" to define a 64 bit value, but 
Microsoft calls them "__int64". I can change the cygwin typedefs from long long 
to __int64, but it's hard to think that this would be required without someone 
describing this somewhere... 

I also see I have definition problems between the Unix version of socket 
utilities and the WinSock version. I believe there is some cygwin define I can 
set to alter that behavior, but I want to address the "long long" problem 
before I go there.... but if you know it off the top of your head, please let 
me know. 

My goal is to have a small program where I can link with the php library, 
instance a PHP engine, and call API functions like php_execute_script().  I 
would like to build this program using the MSVC compiler...

...but if I can't even build the command-line version of PHP, I'm dead in the 

Is this a PHP problem, a Cygwin problem, a Visual Studio problem, or a Me 
problem?  Can you use Cygwin headers with MS VC++ 6.0?  

Thanks for any help/suggestions you can provide -- including alternate 
assistance location(s).

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]