[Mapserver-users] Problem compilation mapscript
Marco Ferrari
Mferrari at crema.unimi.it
Thu Jun 5 02:15:13 PDT 2003
Hy,
I installed mapserver 3.5 on win 2000 and xp with this file structure:
C:\mapserver\freetype-2.0.1
C:\mapserver\gd-1.8.4
C:\mapserver\JPEG-6B
C:\mapserver\libpng-1.0.8
C:\mapserver\Proj-4.4.3
C:\mapserver\REGEX-0.12
C:\mapserver\tiff-v3.5.7
C:\mapserver\zlib-1.1.3
C:\mapserver\gdal-1.1.5
The compilation is ok. My problem is mapscript.
I installed php4 and apache with "Appserv":
C:\Appserv\apache
C:\Appserv\php
and I modified the makefile.vc in the directory C:\mapserver\mapscript\php3:
<
#
# makefile.vc - MSVC++ makefile for the PHP/MapScript extension
#
# This VC++ makefile will build the PHP module PHP_MAPSCRIPT.DLL
#
# To use the makefile:
# - Open a DOS prompt window
# - Run the VCVARS32.BAT script to initialize the VC++ environment variables
# - Start the build with: nmake /f makefile.vc
#
# $Id: Makefile.vc,v 1.10 2001/10/23 19:17:38 assefa Exp $
#
# To use PHP4 (instead of PHP3) uncomment the following line
# The default when PHP4=1 is not set is to build for PHP3
PHP4 = 1
!ifdef PHP4
OPTFLAGS = /nologo /Zi /W3 /Fdphpms.pdb
BASE_CFLAGS = $(OPTFLAGS) /DWIN32 /DZEND_WIN32 /DPHP_WIN32 /DPHP4 /DZTS
!else
OPTFLAGS = /nologo /Zi /W3
BASE_CFLAGS = $(OPTFLAGS) /DWIN32
!endif
#LINK_OPT = /dll /debug
LINK_OPT = /dll /debug
#
# Set PHP_SOURCE_DIR to point to the root of the PHP source tree
#
!ifdef PHP4
PHP_SOURCE_DIR = ../../../AppServ/php
PHP_INC = -I$(PHP_SOURCE_DIR) -I$(PHP_SOURCE_DIR)/main -I$(PHP_SOURCE_DIR)/zend -I$(PHP_SOURCE_DIR)/include -I$(PHP_SOURCE_DIR)/tsrm
!else
PHP_SOURCE_DIR = ../../../php-3.0.14
PHP_INC = -I$(PHP_SOURCE_DIR) -I$(PHP_SOURCE_DIR)/dl
!endif
#
# Where do you want php3_mapscript.dll to be installed?
#
!ifdef PHP4
PHP_INSTALL_DIR = \AppServ\php\extensions
!else
PHP_INSTALL_DIR = \Apache\php3
!endif
#
# Set MapServer extensions parameters. See main MapServer Makefile for
# more details...
# Common defaults are:
# MS_DEFINE = -DUSE_TTF -DUSE_TIFF -DUSE_EPPL -DUSE_GD_1_2
# MS_INCLUDE = -I../.. -I../../gd-1.2 -I../../gdft
# MS_LIBS = -L../.. -lmap -L../../gdft -lgdft -ltiff -lttf -L../../gd-1.2 -lgd
#
MS_DEFINE = -DUSE_EPPL -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_TTF -DUSE_PROJ -DUSE_TIFF -DUSE_TTF -DUSE_OGR -DUSE_GDAL
!ifdef PHP4
MS_INC = -I../.. -I$(PHP_SOURCE_DIR)/regex -DPHP_NO_ALIASES -I../../gd-1.8.4 -I../../../proj-4.4.3/src
!else
MS_INC = -I../.. -I$(PHP_SOURCE_DIR)/regex -I../../../gd-1.8.4 -I../../../proj-4.4.3/src
!endif
GDAL_DIR= ../../../mapserver/gdal-1.1.5
MS_LIBS = ../../mapserver.lib \
../../../mapserver/gd-1.8.4/gd.lib \
../../../mapserver/libpng-1.0.8/libpng.lib \
../../../mapserver/zlib-1.1.3/zlib.lib \
../../../mapserver/jpeg-6b/libjpeg.lib \
../../../mapserver/freetype-2.0.1/lib/freetype200b8MT.lib \
../../../mapserver/tiff-v3.5.7/libtiff/libtiff.lib \
../../../mapserver/proj-4.4.3/src/proj.lib \
$(GDAL_DIR)/ogr/ogrsf_frmts/ogrsf_frmts.lib \
$(GDAL_DIR)/ogr/ogrsf_frmts/ogrsf_frmts_sup.lib \
$(GDAL_DIR)/ogr/ogr.lib \
$(GDAL_DIR)/ogr/../port/cpl.lib
#
# The rest of the file should not have to be edited...
#
PHPMS_OBJS = php_mapscript_util.obj php_mapscript.obj mapscript_i.obj
PHPPROJ_OBJS = php_mapscript_util.obj php_proj.obj
!ifdef PHP4
PHPMS_DLL = php_mapscript.dll
!else
PHPMS_DLL = php3_mapscript.dll
!endif
PHPPROJ_DLL = php_proj.dll
CFLAGS = $(BASE_CFLAGS) $(MS_DEFINE) $(MS_INC) $(PHP_INC) $(PRIOLIST)
default: all
all: $(PHPMS_DLL) $(PHPPROJ_DLL)
mapscript: $(PHPMS_DLL)
proj: $(PHPPROJ_DLL)
install: all
copy $(PHPMS_DLL) $(PHP_INSTALL_DIR)
!ifdef PHP4
$(PHPMS_DLL): $(PHPMS_OBJS)
link $(LINK_OPT) /out:$(PHPMS_DLL) $(PHPMS_OBJS) $(MS_LIBS) \
$(PHP_SOURCE_DIR)\lib\php4ts.lib
$(PHPPROJ_DLL): $(PHPPROJ_OBJS)
link $(LINK_OPT) /out:$(PHPPROJ_DLL) $(PHPPROJ_OBJS) $(MS_LIBS) \
$(PHP_SOURCE_DIR)\lib\php4ts.lib
!else
$(PHPMS_DLL): $(PHPMS_OBJS)
link $(LINK_OPT) /out:$(PHPMS_DLL) $(PHPMS_OBJS) $(MS_LIBS) \
$(PHP_SOURCE_DIR)\win32\cgi_debug\php.lib
$(PHPPROJ_DLL): $(PHPPROJ_OBJS)
link $(LINK_OPT) /out:$(PHPPROJ_DLL) $(PHPPROJ_OBJS) $(MS_LIBS) \
$(PHP_SOURCE_DIR)\win32\cgi_debug\php.lib
!endif
$(PHPMS_OBJS): php_mapscript_util.h php_mapscript.h $(MS_LIBS)
.c.obj:
$(CC) $(CFLAGS) /DCOMPILE_DL=1 /c $*.c /Fo$*.obj
clean:
del *.obj
del $(PHPMS_OBJS)
del $(PHPPROJ_OBJS)
del $(PHPMS_DLL)
del $(PHPPROJ_DLL)
del *.lib
del *.pdb
del *.exp
del *.ilk
>
but on the VisualC I received the following error:
cl /nologo /Zi /W3 /Fdphpms.pdb /DWIN32 /DZEND_WIN32 /DPHP_WIN32 /DPHP4
/DZTS -DUSE_EPPL -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_G
D_TTF -DUSE_PROJ -DUSE_TIFF -DUSE_TTF -DUSE_OGR -DUSE_GDAL -I../.. -I../../../Ap
pServ/php/regex -DPHP_NO_ALIASES -I../../gd-1.8.4 -I../../../proj-4.4.3/src -I..
/../../AppServ/php -I../../../AppServ/php/main -I../../../AppServ/php/zend -I../
../../AppServ/php/include -I../../../AppServ/php/tsrm /DCOMPILE_DL=1 /c php_map
script_util.c /Fophp_mapscript_util.obj
php_mapscript_util.c
php_mapscript_util.h(49) : fatal error C1083: Cannot open include file: 'php.h':
No such file or directory
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
Where is my error?
Can you help me?
Thanks.
More information about the MapServer-users
mailing list