Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: mike Message-ID: <1030683319.3d6efab7e8ff7@peer2peerporn.com> Date: Thu, 29 Aug 2002 21:55:19 -0700 To: cygwin AT cygwin DOT com Subject: BUILDING PHP4.2.2 on Windows using supplied .DSW, MS VS C++ 6.0, and Cygwin Headers? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.0 X-Originating-IP: 66.125.169.173 Note-from-DJ: This may be spam 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: http://www.php.net/manual/en/install.windows.php#install.windows.build I have done the following: Downloaded cygwin (the latest version, setup is 2.249.2.5) 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 php.net, 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' listbox. 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: -------------------------------------------------------------------------------- Compiling... php_cli.c 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 redefinition 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 redefinition 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 redefinition [...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 water. 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: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/