Opened 18 years ago

Last modified 15 years ago

#1548 new defect

Building problems with Microsoft Visual.NET 2003

Reported by: Nuno.Silva@… Owned by: assefa
Priority: high Milestone: FUTURE
Component: Build Problems Version: 4.6
Severity: normal Keywords:
Cc: hobu

Description (last modified by dmorissette)

I'm trying to generate the MapServer application using the NMAKE of the MS 
Visual.NET 2003.

I've changed the nmake.opt to be according to my building system and when I 
execute it generates some warnings and errors I'll describe

Here is my nmake.opt:

--- Start of nmake.opt
#
# nmake.opt - MapServer 4.x configuration for MSVC++
#
# This VC++ configuration is used in building MAPSERVER.LIB, MAPSERV.EXE,
# and the other MapServer command-line programs.
#
# 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: nmake.opt,v 1.22.2.1 2005/06/30 14:47:58 assefa Exp $
#
# Contents:
#   Section I:   Mapserver Options (you may want to edit)
#   Section II:  Support Libraries (you must edit)
#   Section III: Debug Flags (no need to edit)
#   Section IV:  Variable Setup (should not need to edit)
#   Section V:   UMN GIS System Setup (should not need to edit)
#   Section VI:  Collect compiler flags
#
########################################################################
# Section I: Mapserver Options
########################################################################

# Uncomment the following to link mapserv.exe with dll
DLLBUILD=1

# Set the following to point to the current directory. 
MS_BASE ="E:\Tmp\MapServer\mapserver-4.6.1"

# Optmization and related compile flags. 

# Optimized, with using MSVCRT. 
OPTFLAGS =	/nologo /MD $(WARNING_LEVEL) $(DEBUG)

#LDFLAGS =	/NODEFAULTLIB:msvcrt /NODEFAULTLIB:libcd /DEBUG

# Debug with MSVCRT
#OPTFLAGS =	/nologo /Zi /MD $(WARNING_LEVEL) $(DEBUG)

# Optimized, with LIBC.
#OPTFLAGS =	/nologo $(WARNING_LEVEL) $(DEBUG)

# Input raster format options:
#
# The lite version of mapserver 4.x supports only GIF, PNG and JPEG data for 
# input. If you wish to support many geospatial raster formats for input
# you will need the GDAL support library from http://www.gdal.org/.  
# Once built, enable the GDAL flag, and point GDAL_DIR to the directory
# where GDAL was built. 
GDAL=-DUSE_GDAL
GDAL_DIR="D:\Program Files\FWTools1.0.0a7"

#
# Input vector format options
#
# The lite version of Mapserver 4.x only suports ESRI shapefiles for input.
#
# The OGR library (part of GDAL) supports a variety of geospatial vector
# formats including mapinfo, Arc/Info binary coverages, S-57, SDTS, 
# Microstation DGN (pre-v7), TIGER, UK .NTF.  It also include support for
# treating non-spatial tablular data from ODBC, CSV, mysql, Oracle Spatial, 
# and PostgreSQL as spatial table with use of the VRT (virtual) driver. 
#
# NOTE: Both -DUSE_OGR and -DUSE_GDAL need to be defined if you want to 
# use GDAL/OGR for both raster and vector support, but GDAL_DIR needs only
# be defined once.
#
OGR=-DUSE_OGR
#GDAL_DIR="D:\Program Files\FWTools1.0.0a7"

# JPEG Input:
# JPEG input for raster layers is also available through GDAL, If you wish 
# to build support for JPEG without GDAL, uncomment the following flag
# and provide the full path to the jpeg support library project directory.
# See http://www.ijg.org/ for support library.
#JPEG=-DUSE_JPEG
#JPEG_DIR="D:\Program Files\GnuWin32"

# Output format options:
# If you wish to allow JPEG output maps, uncomment the following flag.
# If not using a GD build with an internal copy of libjpeg, you will
# also need to uncomment JPEG_DIR and point to it; however, with BGD.DLL
# that is not necessary.
OUTPUT_JPEG=-DUSE_GD_JPEG
#JPEG_DIR=c:/projects/libjpeg

# If you wish to allow PNG output maps, uncomment the following flag.
# If not using a GD build with an internal copy of libpng, you will
# also need to uncomment PNG_DIR and ZLIB_DIR and point to it; however, with 
# BGD.DLL that is not necessary.
# See http://www.libpng.org/pub/png/libpng.html for support library.
# See http://www.gzip.org/zlib/ for support library.
OUTPUT_PNG=-DUSE_GD_PNG
PNG_DIR="D:\Program Files\GnuWin32"
#ZLIB_DIR="D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
\Extentions\ZLib"

#flag to indicate the use of zlib library. It is used intially in SVG
#output to compressed files.
ZLIB=-DUSE_ZLIB

# If you wish to allow Windows BMP output maps, uncomment the following flag.
OUTPUT_WBMP=-DUSE_GD_WBMP

# If you wish to have FLASH output, uncomment the following flag and provide
# the full path to the MING support library project directory.
# See http://ming.sourceforge.net/ for support library.
MING=-DUSE_MING_FLASH
MING_DIR="D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
\Extentions\Ming"


# If you wish to have PDF output, uncomment the following flag and provide the
# full path to the PDF support library project directory.
# See http://www.pdflib.com/ for support library.
PDF=-DUSE_PDF
PDF_DIR="D:\Program Files\GnuWin32"


# Annotation fonts.
#
# If you wish to annotate your maps with true type fonts unccomment the
# following flag. Provide the full path to the FreeType 2.x external
# support library, unless it is provided within your GD build as is the
# case with BGD.DLL.  
# See http://www.freetype.org for support library.
ANNOTATION_FT=-DUSE_GD_FT
#FT_DIR=c:/projects/freetype-2.1.3


# Direct connectivity to Postgresql PostGIS.
# 
# To turn on direct connectivity to Postgresql PostGIS uncomment the following
# flag and set the full path name to the project directory for the 
# Postgresql native Win32 client library.
# See http://www.postgresql.org for support library.
POSTGIS =-DUSE_POSTGIS
POSTGIS_DIR ="D:\Program Files\PostgreSQL\8.1"

#Orcale
#ORACLE=-DUSE_ORACLESPATIAL
#ORACLE_DIR = c:\Oracle\Ora81

# Direct connectivity to ArcSDE.
# 
# To turn on direct connectivity to ArcSDE uncomment the following
# flag and set the full path name to the project directory for ArcSDE.
# Since ESRI includes the version number in the name of their libraries
# you may need to change that number in Section III of this configuration
# file.
# See http://www.esri.com/software/arcgis/arcinfo/arcsde/index.html for
# support library
#
# To include experimental SDE_RASTER support, include "-DUSE_SDERASTER" in the
# SDE_OPT.
#
#SDE_OPT=-DUSE_SDE -DWIN32
#SDE_DIR=c:/my_path_to/arcsde

# EPPL7 Support
#
# This activates ERDAS as well. It is included in the distribution. 
# Probably the best raster alternative if
# you've got EPPL7 laying around. See http://www.lmic.state.mn.us/ for 
# more information.
# Uncomment out the following flag and set the full path name to the
# epplib.obj file.
#EPPL=-DUSE_EPPL
#EPPL_OBJ=c:/my_path/epplib.obj

# If you want to ignore missing datafile errors uncomment the following
# line. This is especially useful with large tiled datasets that may not
# have complete data for each tile.
IGNORE_MISSING_DATA=-DIGNORE_MISSING_DATA

# If you want to use shape Z and M parameter this option must be set.
# It's OFF by default.
#USE_POINT_Z_M=-DUSE_POINT_Z_M
USE_POINT_Z_M=

#NEED_NONBLOCKING_STDERR=-DNEED_NONBLOCKING_STDERR
ENABLE_STDERR_DEBUG=-DENABLE_STDERR_DEBUG

# If you want antialiasing (note that It requires gd2)
USE_GD_ANTIALIAS=-DUSE_GD_ANTIALIAS

# Enable if you want thread safe locking, not needed for simple CGI.
THREADS=-DUSE_THREAD

# Use this flag to compile with WMS Server support.
# To find out more about the OpenGIS Web Map Server Specification go to
# http://www.opengis.org/
WMS=-DUSE_WMS_SVR

# Use this flag to compile with WMS Client support. WMS Client support
# allows you to pull layers from other OGIS WMS servers on the interent and
# incorporate them into your map.
# To find out more about the OpenGIS Web Map Server Specification go to
# http://www.opengis.org/
# you need the libcurl library from http://curl.haxx.se/library/c/
# Set the full path to the curl project directory.
# You may also need to the full path to the windows socket library.
WMSCLIENT= -DUSE_WMS_LYR

CURL_DIR="D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
\Extentions\Curl"
WINSOCK_LIB = "WSOCK32.LIB"
WINSOCK_LIB = "D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
\PlatformSDK\Lib\WSOCK32.LIB"

# Use -DUSE_WFS_SVR to compile with WFS server support, requires OGR and PROJ4
WFS=-DUSE_WFS_SVR

# Use -DUSE_WFS_LYR to compile with WFS client support, requires libcurl
WFSCLIENT= -DUSE_WFS_LYR

# Use -DUSE_WCS_SVR to compile with WCS server support, requires GDAL.
WCS=-DUSE_WCS_SVR

#libiconv support is used for to support double bytes (see bug 911).
#uncomment the following to build with libiconv support.
ICONV=-DUSE_ICONV


# Reprojecting.
# If you would like mapserver to be able to reproject data from one
# geographic projection to another, uncomment the following flag
# Proj.4 distribution (cartographic projection routines).  PROJ.4 is
# also required for all OGC services (WMS, WFS, and WCS). 
#
# For PROJ_DIR use full path to Proj.4 distribution
PROJ=-DUSE_PROJ -DUSE_PROJ_API_H
PROJ_DIR="D:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
\Extentions\Proj.4"

# PHP Mapscript.
# If you plan to build PHP mapscript uncomment the following flag and
# set the full path to the PHP project directory
#PHP=1
#PHP_DIR=c:\projects\php-4.3.4

# Apparently these aren't as commonplace. Edit the
# following line to reflect the missing functions on your platform.
#
#STRINGS=-DNEED_STRCASECMP -DNEED_STRNCASECMP -DNEED_STRDUP
STRINGS=-DNEED_STRCASECMP -DNEED_STRNCASECMP -DNEED_STRLCAT


########################################################################
# Section II: External Support Libraries
########################################################################
# You will need to set the paths to various support library projects
# that you have compiled.
########################################################################

# GD Library.  
#
# Mapserver 4.x only supports GD 2.x and greater.
# Sorry no more GIF support.  If you need GIF support you will
# need to run Mapserver 3.6.x with GD 1.2.
# GD is a required support library for MapServer 4.x.
# Enter the full path to your GD 2.x project directory

# Note : A patched version of GD that supports GIF, JPEG, PNG and WBMP can be 
# downloaded from http://www.rime.com.au/gd/. If you are using this library,
#you should uncomment the following line
OUTPUT_GIF=-DUSE_GD_GIF -DGD_HAS_GDIMAGEGIFPTR

GD_DIR="D:\Program Files\GnuWin32"
GD_LIB=$(GD_DIR)/lib/libgd.lib

#if the GD version you are using is above GD 2.0.22, uncomment the following 
flag to
#have a proper support for bitmap fonts (see Bug 969 for more details)
GD_HAS_GETBITMAPFONT=-DGD_HAS_GETBITMAPFONT

# REGEX Libary
# 
# VC++ does not include the REGEX library... so we must provide our one.
# The following definitions will try to build GNU regex-0.12 located in the
# regex-0.12 sub-directory.
# If it was not included in the source distribution, then you can get it from:
#    ftp://ftp.gnu.org/pub/gnu/regex/regex-0.12.tar.gz
# Provide the full path to the REGEX project directory
# You do not need this library if you are compiling for PHP mapscript.
# In that case the PHP regex library will be used instead
!IFNDEF PHP
REGEX_DIR="D:\Program Files\GnuWin32"
!ENDIF

# FastCGI Support
#
# Uncomment, and update accordingly. 
#FCGIDIR=C:\projects\fcgi-2.4.0
#FCGILIB=$(FCGIDIR)\libfcgi\Debug\libfcgi.lib
#FCGIINC=-I$(FCGIDIR)\include
#FCGIDEF=-DUSE_FASTCGI

########################################################################
# Section III: Debug flags
########################################################################
# Should not need to be updated.
########################################################################
# DEBUG Build flags
# Set the DEBUG flag if you wish to make a debug build
DEBUG=/DDEBUG
# Set the Warning level for the compiler (defaults to W1)
WARNING_LEVEL=/W3
# Set the linker debug option
LDEBUG=/debug


########################################################################
# Section IV: Variable Setup
########################################################################
# Should not need to be updated.
########################################################################

MS_LIB = 	mapserver.lib
MS_LIB_DLL  =	mapserver_i.lib

# Proj.4 include and library
!IFDEF PROJ_DIR
PROJ_INC=-I$(PROJ_DIR)\include
PROJ_LIB=$(PROJ_DIR)\lib\proj_i.lib
!ENDIF

# CURL include and library
!IFDEF WMSCLIENT
CURL_INC = -I$(CURL_DIR)\include
CURL_LIB = $(CURL_DIR)\lib\libcurl.lib
!ENDIF

# Set the jpeg library
!IFDEF JPEG_DIR
JPEG_LIB=$(JPEG_DIR)\lib\libjpeg.lib
!ENDIF

# Set the png support libaries
!IFDEF PNG_DIR
PNG_LIB=$(PNG_DIR)\lib\libpng.lib $(ZLIB_DIR)\lib\zlib.lib
!ENDIF

# Set the FreeType library
!IFDEF FT_DIR
#FT_LIB=$(FT_DIR)/objs/freetype211.lib
FT_LIB=$(FT_DIR)/objs/freetype211ST_D.lib
!ENDIF

# GD include and library
GD_INC=	-I$(GD_DIR)/include
GD_LIBS= $(GD_LIB) $(JPEG_LIB) $(PNG_LIB) $(FT_LIB)
GD= $(OUTPUT_PNG) $(OUTPUT_JPEG) $(OUTPUT_WBMP) $(OUTPUT_GIF) $(ANNOTATION_FT) 
$(GD_HAS_GETBITMAPFONT)

# Tiff library on input
!IFDEF TIFF
TIFF_INC=-I$(TIFF_DIR)/libtiff
TIFF_LIB=$(TIFF_DIR)/libtiff/libtiff.lib
!ENDIF

# JPEG library on input
!IFDEF JPEG_DIR
JPEG_LIB=$(JPEG_DIR)/libjpeg.lib
!ENDIF

# Setup GDAL includes and libraries
!IFDEF GDAL
GDAL_INC = -I$(GDAL_DIR)/include
GDAL_LIB = $(GDAL_DIR)/lib/gdal_i.lib
!ENDIF

# Setup OGR includes and libraries
!IFDEF OGR
OGR_INC = -I$(GDAL_DIR)/ogr/ogrsf_frmts -I$(GDAL_DIR)/ogr -I$(GDAL_DIR)/include
OGR_LIB = $(GDAL_DIR)/lib/gdal_i.lib
!ENDIF

# Setup ESRI SDE support.
!IFDEF SDE_OPT
SDE_INC=-I$(SDE_DIR)/include
SDE_LIB=$(SDE_DIR)/lib/sde80.lib $(SDE_DIR)/lib/sg80.lib 
$(SDE_DIR)/lib/pe80.lib
!ENDIF

# Setup REGEX object and includes
!IFNDEF PHP
#REGEX_OBJ=$(REGEX_DIR)\regex.obj
REGEX_INC=-I$(REGEX_DIR)\include
!ELSE
REGEX_OBJ=$(PHP_DIR)\regex\regcomp.obj $(PHP_DIR)\regex\regerror.obj \
          $(PHP_DIR)\regex\regexec.obj $(PHP_DIR)\regex\regfree.obj
REGEX_INC=-I$(PHP_DIR)/regex -DPHP_NO_ALIASES
!ENDIF
#
# REGEX needs some special flags... here they are for VC++ 6.0
#
REGEX_OPT=-DHAVE_STRING_H -DREGEX_MALLOC

# Setup Postgesql PostGIS includes and libs
# Note that the Postgresql includes are not used in the compilation of 
# PHP/MapScript.  The reason is that there is a name conflict between the 
# regex/regex.h files used in PHP and Postgresql.  This is not a real issue
# since they are two completely different interfaces.  The issue arrises when
# the php_regex.h trys to include regex/regex.h and gets the wrong one from
# postgresql.  Therefore we do not give it that opertunity by not providing the
# include path.
!IFDEF POSTGIS
!IFNDEF PHP_BUILD_CALL
POSTGIS_INC=-I$(POSTGIS_DIR)/interfaces/libpq -I$(POSTGIS_DIR)/include
!ENDIF
POSTGIS_LIB=$(POSTGIS_DIR)/interfaces/libpq/libpqdll.lib
POSTGIS_OBJ=mappostgis.obj
!ENDIF

# Setup FLASH includes and libs
!IFDEF MING
MING_INC=-I$(MING_DIR)
MING_LIB= $(MING_DIR)/lib/libming.lib
MING_VERSION=-DMING_VERSION_03
!ENDIF

# Setup PDF includes and libs
!IFDEF PDF
PDF_LIB=$(PDF_DIR)/lib/pdflib.lib
PDF_INC=-I$(PDF_DIR)/include
!ENDIF

#Oracle support
!IFDEF ORACLE
ORACLE_INC=-I$(ORACLE_DIR)/oci/include
ORACLE_LIB=$(ORACLE_DIR)/oci/lib/msvc/oci.lib
!ENDIF

#libiconv support
!IFDEF ICONV
ICONV_LIB="D:\Program Files\GnuWin32\lib"
ICONV_INC= -I"D:\Program Files\GnuWin32\include"
!ENDIF


########################################################################
# Section V: UMN GIS System Support
########################################################################
# Should not need to be updated.
########################################################################
#
# UofMN GIS/Image Processing Extension (very experimental)
#
#EGIS=-DUSE_EGIS

!IFDEF EGIS
ERR_DIR=c:/my_path_to/errLog
ERR_OBJ=$(ERR_DIR)/errLog.o
ERR_INC=-I$(ERR_DIR)
ERR_LIB=-L$(ERR_DIR) -lerrLog

IMGGEN_DIR=c:/my_path_to/imgSrc
IMGGEN_OBJ=$(IMGGEN_DIR)/imgLib.o
IMGGEN_INC=-I$(IMGGEN_DIR)
IMGGEN_LIB=-L$(IMGGEN_DIR) -limgGEN
!ENDIF

########################################################################
# Section VI: Collect compiler flags
########################################################################
# Should not need to be updated.
########################################################################
EXTERNAL_LIBS=$(GD_LIBS) $(TIFF_LIB) $(JPEG_LIB) \
     $(PROJ_LIB) $(OGR_LIB) $(GDAL_LIB)\
     $(CURL_LIB)  $(MING_LIB) $(PDF_LIB) \
     $(WINSOCK_LIB) $(POSTGIS_LIB) $(IMGGEN_LIB) $(ERR_LIB) \
     $(ORACLE_LIB) $(SDE_LIB) $(ICONV_LIB) $(FCGILIB)

LIBS=$(MS_LIB) $(EXTERNAL_LIBS)
LIBS_DLL=$(MS_LIB_DLL) $(EXTERNAL_LIBS)

INCLUDES=$(GD_INC) $(TIFF_INC) $(JPEG_INC)  \
         $(PROJ_INC) $(REGEX_INC) $(GDAL_INC) $(OGR_INC) \
         $(CURL_INC) $(MING_INC) $(PDF_INC) $(POSTGIS_INC) \
         $(IMGGEN_INC) $(ERR_INC) $(ORACLE_INC) $(SDE_INC)\
         $(ICONV_INC) $(FCGIINC)
        

MS_DEFS = $(REGEX_OPT) $(STRINGS) $(POSTGIS)  -DWIN32 -D_WIN32 \
          $(EPPL) $(PROJ) $(TIFF) $(JPEG) $(GD) $(OGR) $(WMS) $(THREADS) \
          $(WMSCLIENT) $(MING) $(IGNORE_MISSING_DATA) 
$(NEED_NONBLOCKING_STDERR) $(ENABLE_STDERR_DEBUG) \
          $(USE_POINT_Z_M) $(GDAL) $(FCGIDEF) \
          $(WFS) $(WFSCLIENT) $(WCS) $(PDF) $(EGIS) \
        $(USE_GD_ANTIALIAS) $(ORACLE) $(MING_VERSION) $(SDE_OPT) $(ICONV)

MS_CFLAGS=$(INCLUDES) $(MS_DEFS)

--- End of nmake.opt

1-In file "maptempalte.c" it generates:
    "maptemplate.c(3093) : warning C4013: 'getpid' undefined; assuming extern 
returning int"
To remove this warning I suggest the following lines
    #if defined(_WIN32) && !defined(__CYGWIN__)
    #   include <process.h>
    #else
    #   include <unistd.h>
    #endif

I've found that Microsoft had included a version of <unistd.h> but I suggest 
the previous code to ensure it generates with MSVC++ 6.0.

2-In file mapgml.c it generates:
    "mapgml.c(831) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data"
    "mapgml.c(835) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data"
 
Since “geometry->occurmin” and “geometry->occurmax” are of type “int” I 
suggest changing atof(
) to atoi(
)

3-In file mapdraw.c it generates:
    “mapdraw.c(455) : warning C4013: 'msDrawWMSLayerSWF' undefined; assuming 
extern returning int”
    “mapdraw.c(462) : warning C4013: 'msDrawWMSLayerPDF' undefined; assuming 
extern returning int”

The first warning occurs because in file “map.h” the declaration 
of “msDrawWMSLayerSWF” is comment. I suggest moving the #include “mapows.h” 
from the end of the file to somewhere above the forward declaration of the 
functions in “mapswf.c” file and uncomment the “msDrawWMSLayerSWF” with the 
following signature:
“#ifdef USE_WMS_LYR 
 MS_DLL_EXPORT int msDrawWMSLayerSWF(int nLayerId, httpRequestObj *pasReqInfo, 
int numRequests, mapObj *map, layerObj *layer, imageObj *image);
 #endif”

The second warning occurs for the same reason.
Reading the revision I verified that this function was removed. But I don’t 
understand why. I suggest reintroducing this function prototype if 
#include “mapows.h” was moved has previous stated.
 
4-In file mapgd.c it generates:
    “mapgd.c(1501) : warning C4244: 'function' : conversion from 'double' 
to 'int', possible loss of data”
    “mapgd.c(1502) : warning C4244: 'function' : conversion from 'double' 
to 'int', possible loss of data”
    “mapgd.c(1504) : warning C4244: 'function' : conversion from 'double' 
to 'int', possible loss of data”

Do explicit cast to “int” on parameter “style->ang” to avoid these warnings 

5-In file mapswf.c it generates:
    “mapswf.c(385) : warning C4013: 'compress2' undefined; assuming extern 
returning int”
    “mapswf.c(508) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(593) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(599) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'“
    “mapswf.c(784) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(791) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(795) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(846) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(852) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(1043) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'”
    “mapswf.c(1047) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'”
    “mapswf.c(1053) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'”
    “mapswf.c(1058) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'”
    “mapswf.c(1129) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'”
    “mapswf.c(1137) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'”
    “mapswf.c(1338) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'”
    “mapswf.c(1357) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'”
    “mapswf.c(1384) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'”
    “mapswf.c(1422) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'”
    “mapswf.c(1436) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'”
    “mapswf.c(1475) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'”
    “mapswf.c(1498) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'”
    “mapswf.c(1577) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    “mapswf.c(1584) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'”
    "mapswf.c(1588) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'"
    "mapswf.c(1613) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'"
    "mapswf.c(1618) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFCharacter'"
    "mapswf.c(1777) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFBlock'"
    "mapswf.c(1784) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'"
    "mapswf.c(1914) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFBlock'"
    "mapswf.c(1921) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'"
    "mapswf.c(1959) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFBlock'"
    "mapswf.c(1966) : warning C4133: 'function' : incompatible types - 
from 'SWFButton' to 'SWFBlock'"
    "mapswf.c(2084) : warning C4133: 'function' : incompatible types - 
from 'SWFText' to 'SWFBlock'"
    "mapswf.c(2246) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFBlock'"
    "mapswf.c(2632) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFBlock'"
    "mapswf.c(2686) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFBlock'"
    "mapswf.c(2833) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2837) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2841) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2846) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2854) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2859) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2864) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2871) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2976) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(2992) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(3001) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"
    "mapswf.c(3007) : warning C4133: 'function' : incompatible types - 
from 'SWFAction' to 'SWFBlock'"    
    "mapswf.c(3165) : warning C4133: 'function' : incompatible types - 
from 'SWFShape' to 'SWFBlock'”

The first warning occurs because the zlib include is wrongly enclosed by the 
#if !defined(_WIN32) 
 #endif
I have the zlib installed on my _WIN32 platform and I wanted to use it. 
Therefore the zlib include shall be enclosed like this:
    #ifdef USE_ZLIB 
    #    include <zlib.h>
    #endif
Also in namke.opt must add the $(ZLIB) to the $(MS_DEFS)

The warnings caused by 'SWFShape' to 'SWFCharacter' occur because the 
SWFButton_addShape signature is “void SWFButton_addShape(SWFButton button, 
SWFCharacter character, byte flags);” and not
“void SWFButton_addShape(SWFButton button, SWFShape shape, byte flags);”. I’m 
using the Ming 0.3a version.
Seeing through the Ming’s documentation I’ve found that SWFCharacter the 
parent definition for all SWFBitmap, SWFShape, SWFMorph, SWFSound, SWFSprite 
types. For that it shall be necessary to cast any SWFCharacter derived types 
to SWFCharacter in any Ming’s API functions.

The warnings 'SWFAction' to 'SWFBlock' are similar to 'SWFShape' 
to 'SWFCharacter' warnings, SWFBlock is the parent for SWFAction. It shall be 
necessary to cast any SWFBlock derived types to SWFBlock in any Ming’s API 
functions. The same applies to 'SWFButton' to 'SWFBlock', 'SWFShape' 
to 'SWFBlock' and 'SWFText' to 'SWFBlock' warnings

6-In file mappdf.c it generates:
    “mappdf.c(312) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data”
    “mappdf.c(826) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data”
    “mappdf.c(883) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data”
    “mappdf.c(928) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data”
    “mappdf.c(929) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data”
    “mappdf.c(1313) : warning C4244: 'initializing' : conversion from 'double' 
to 'float', possible loss of data”
    “mappdf.c(1336) : warning C4244: '=' : conversion from 'double' to 'int', 
possible loss of data”
    “mappdf.c(1350) : warning C4047: '=' : 'int' differs in levels of 
indirection from 'char *'”

The first three warning occurs because the function msSymbolGetDefaultSize 
returns a “double” and size is “int”. I suggest to the following line:
    size = MS_NINT( msSymbolGetDefaultSize( &( symbolset->symbol[style-
>symbol] ) ) );

To remove the forth warning, change the line 928 to;
    x = (int) p->x - (int)(.5*PDF_stringwidth(pdf,symbolBuffer,font_id,size)));

To remove the fifth warning, change the line 929 to:
    y = (int)p->y;

The sixth warning is resolved converting the variable phi from float to double 
since the PDF API functions used receive doubles.

The seventh warning can be removed changing the line 1336 to
    size = (int)(label->size*scalefactor);

The last warning occurs because “msLookupHashTable” function returns “char*” 
and not “int”. I suggest changing the code:
    font = msLookupHashTable(&(fontset->fonts), label->font);

    if(!font)
to:
    if( !msLookupHashTable(&(fontset->fonts), label->font) )


These are mostly warnings but it can cause some unpredictable results.

Thanks for your time

Attachments (1)

makefile.patch.zip (7.0 KB ) - added by Nuno.Silva@… 18 years ago.
More custumizable makefile for Windows

Download all attachments as: .zip

Change History (6)

by Nuno.Silva@…, 18 years ago

Attachment: makefile.patch.zip added

More custumizable makefile for Windows

comment:1 by assefa, 18 years ago

Milestone: 4.8 release
Thanks for all this. Are your comments/changes based on the mapserver cvs ? (I
see the Vesion is set to 4.6 in this bug). All this should apply to 4.6 release
as well as the 4.8 release but I think It only make sense to correct them for
the 4.8 release that is comming pretty soon.

I will integrate your changes in the coming hours or early Monday. 

comment:2 by dmorissette, 17 years ago

Cc: hobu added
Description: modified (diff)
Owner: changed from mapserverbugs to assefa

Reassigned to Assefa. Lots must have changed in the Windows build process since this ticket was submitted... is it still valid?

comment:3 by hobu, 17 years ago

Milestone: 5.0 release5.2 release

Pushing forward to 5.2, when we will hopefully deal with more of our windows warnings

comment:4 by dmorissette, 16 years ago

Milestone: 5.2 release5.4 release

comment:5 by assefa, 15 years ago

Milestone: 5.6 releaseFUTURE
Note: See TracTickets for help on using tickets.