|
From: | James Gate |
Subject: | Compiling GNU Prolog under Windows 7 with MSVC++ 2008 |
Date: | Sun, 15 Nov 2009 13:11:26 +0000 |
User-agent: | Thunderbird 2.0.0.23 (Windows/20090812) |
Hi, * I am running GNU Prolog on an x86 running the 32-bit version of Windows 7. * My compiler is Microsoft Visual C++ 2008 Express Edition - i.e. the free one. * I have the latest version of the Windows SDK installed - i.e. the one with Windows 7 support. * The following is about GNU Prolog Version 1.3.1. If I download the GNU Prolog windows installer package (for MSVC), the interpreter works fine but the compiler fails to link due to the library 'libcp.lib' having been renamed to 'libc.lib' in the move from VC++ 2005 to 2008. Therefore I decided to compile GNU Prolog from source using VC++ 2008. I did this as follows: 1. Extract archive. 2. Open up VC++ 2008 command prompt and 'cd' into C:\<extract location>\gprolog-1.3.1\src 3. Execute the command 'sh configure --with-msvc --with-install-dir=/c/Dev/GProlog' 4. Execute 'make' 5. Execute 'make install' * The command 'sh' comes from MSys 1.0, whose 'bin' directory is in my PATH environment variable. * Initially step 3 failed because there was no 'mingw-as.exe' in my path, but 'as.exe' (from MinGW 5.1.4) was, so I simply copied 'as.exe' to 'mingw-as.exe' in MinGW's 'bin' directory. * Step 4 failed with the following error: (cd ../TopComp; make gplc.exe) make[2]: Entering directory `/c/Users/James/Desktop/gprolog-1.3.1/src/TopComp' cl -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -O2 -EHsc -Feg plc.exe top_comp.c advapi32.lib user32.lib ws2_32.lib top_comp.c C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(272) : error C31 63: 'getc': attributes inconsistent with previous declaration C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(214) : s ee declaration of 'getc' make[2]: *** [gplc.exe] Error 2 make[2]: Leaving directory `/c/Users/James/Desktop/gprolog-1.3.1/src/TopComp' make[1]: *** [wam_regs.h] Error 2 make[1]: Leaving directory `/c/Users/James/Desktop/gprolog-1.3.1/src/EnginePl' make: *** [all] Error 2 Which can be fixed in the file 'EnginePl\arch_dep.h' by either commenting out the block: #ifndef HAVE_FGETC #define fgetc getc #endif Or adding the line #define HAVE_FGETC before the block. Everything seems to be running as per normal and I can successfully compile and link programs. I assume the above problem in 'arch_dep.h' is something to do with the 'configure' script, but I have zero experience with these so any fix I produce will most likely only work on my platform! Kind Regards, James Gate, PhD Student, Algorithms and Complexity Resarch Group, University of Durham, UK. |
[Prev in Thread] | Current Thread | [Next in Thread] |