[Gdal-dev] gdal_translate
Ayman Kamal
kamal_jo at yahoo.com
Mon Feb 17 03:22:17 EST 2003
Ok Sir,
I read nmake.opt and apps\makefile.vc
I didn't change makevile.vc
I changed nmake.opt to be as follows, and then used
Windows Command Prompt to invoke make file from within
the apps directory:
nmake /f makefile.vc
After that I got the following error:
NMAKE : fatal error U1073: don't know how to make
'../gdal.lib'
Stop.
Here is the namke.opt file listing
//--------------------------------------------------
//nmake.opt
//--------------------------------------------------
# Location to install .exe, .dll and python stuff
BINDIR = E:\Work\BIN
PY_INST_DIR = E:\Work\BIN\pymod
LIBDIR = E:\Work\BIN\lib
INCDIR = E:\Work\BIN\include
# Set this to the installed directory containing
python. If you don't
# have python just let it point to a directory that
does not exist (as now).
PYDIR = E:\Work\Software\Python22
# Uncomment the first for an optimized build or the
second for a debug build.
#OPTFLAGS= /nologo /Ox
OPTFLAGS= /nologo /Zi /Fd$(GDAL_ROOT)\gdal.pdb
# Version number embedded in DLL name.
VERSION = 11
# Uncomment the following to link OGR utilities
against main GDAL DLL
# instead of statically linking against OGR libraries.
DLLBUILD=1
# Enable all OGR formats, or only raster formats?
Comment out to disable
# vector formats.
#INCLUDE_OGR_FRMTS = YES
# Location of Visual C++ directory (only required for
following SETARGV stuff)
VCDIR = D:\Program Files\Microsoft Visual
Studio\VC98
# Enable the following if VCDIR set properly, and you
want the utility
# programs to be able to expand wildcards.
#SETARGV = $(VCDIR)\lib\setargv.obj
# Comment out the following to disable JPEG support.
#JPEG_SUPPORTED = 1
# Uncomment the following and update to enable ECW
support.
#ECWDIR = D:\Software\ECW_SDK
#ECWLIB = $(ECWDIR)\lib\NCSEcw.lib
$(ECWDIR)\lib\NCSEcwC.lib \
# $(ECWDIR)\lib\NCSUtil.lib
# Uncomment the following and update to enable OGDI
support.
#OGDIDIR = D:\warmerda\iii\devdir
#OGDIVER = 31
#OGDILIB = $(OGDIDIR)\lib\$(TARGET)\ogdi$(OGDIVER).lib
\
# $(OGDIDIR)\lib\$(TARGET)\zlib_ogdi$(OGDIVER).lib
# Uncomment for Xerces based GML support.
#XERCES_DIR =
d:\warmerda\iii\drivers\gml\xerces-c1_7_0-win32
#XERCES_INCLUDE = -I$(XERCES_DIR)/include
-I$(XERCES_DIR)/include/xercesc
#XERCES_LIB = $(XERCES_DIR)/lib/xerces-c_1.lib
# Uncomment for JPEG2000 support
#JASPER_DIR = S:\projects_libs\jasper-1.500.4
#JASPER_INCLUDE =
-I$(JASPER_DIR)\src\libjasper\include\jasper
#JASPER_LIB =
$(JASPER_DIR)src\msvc\Win32_Release\libjasper.lib
# Uncommment if you have Frank's modified Kakadu
build.
#KAKDIR = D:\warmerda\jp2\kakadu
# Uncomment the following and update to enable NCSA
HDF Release 4 support.
#HDF4_DIR = D:\warmerda\HDF41r5
#HDF4_LIB = /LIBPATH:$(HDF4_DIR)\lib
# Uncomment the following and update to enable FME
support.
#FME_DIR = d:\Software\fme
!IFDEF ORACLE_HOME
OCI_LIB = $(ORACLE_HOME)\oci\lib\msvc\ociw32.lib \
$(ORACLE_HOME)\oci\lib\msvc\oci.lib
!ENDIF
########### END OF STUFF THAT NORMALLY NEEDS TO BE
UPDATED ##################
# Location of MS Data Access SDK (not really needed
anymore I think)
#MSDASDK = D:\Software\MDAC_2.6
GDAL_DLL = gdal$(VERSION).dll
INC = -I$(GDAL_ROOT)\port -I$(GDAL_ROOT)\ogr
-I$(GDAL_ROOT)\core
#LINKER_FLAGS = /NODEFAULTLIB:LIBC
CFLAGS = $(OPTFLAGS) $(INC) $(EXTRAFLAGS)
MAKE = nmake /nologo
CC = cl
CPLLIB = $(GDAL_ROOT)/port/cpl.lib
GDALLIB = $(GDAL_ROOT)/gdal.lib
.c.obj:
$(CC) $(CFLAGS) /c $*.c
.cpp.obj:
$(CC) $(CFLAGS) /c $*.cpp
//--------------------------------------------------
--- Frank Warmerdam <warmerdam at pobox.com> wrote:
> Ayman Kamal wrote:
> > I want to use it as a statically linked library.
> > Can you give me more explanation building apon
> this
> > fact?
>
> Ayman,
>
> Since the 1.1.8 release I have added a "devinstall"
> target to the makefile.vc.
> This will copy all include files and the gdal_i.lib
> stub library to a target
> location specified in nmake.opt.
>
> However, if you want to link against static
> libraries instead of the stub
> library for use of the DLL things are substantially
> more complicated. I
> think you would need the following directories in
> your include path:
>
> $(GDAL_HOME)\port
> $(GDAL_HOME)\core
> $(GDAL_HOME)\ogr
>
> You will need to link against the following library
> files:
> $(GDAL_HOME)\gdal.lib
> $(GDAL_HOME)\port\cpl.lib
> $(GDAL_HOME)\ogr\ogr.lib
>
> If you are building a Visual Studio project you will
> also need to ensure
> that you use compatible compile options for the GDAL
> static libraries and
> your project. It is likely best to modify the
> OPTFLAGS macro in the nmake.opt
> file to match your visual studio project and rebuild
> GDAL.
>
> I would stess though, that using the DLL is the
> preferred mechanism for using
> GDAL. It is easier to build.
>
> Good luck,
>
> --
>
---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up | Frank
> Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows |
> http://pobox.com/~warmerdam
> and watch the world go round - Rush | Geospatial
> Programmer for Rent
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at remotesensing.org
> http://remotesensing.org/mailman/listinfo/gdal-dev
__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
More information about the Gdal-dev
mailing list