<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE>.hmmessage P {
        PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px
}
BODY.hmmessage {
        FONT-SIZE: 10pt; FONT-FAMILY: Verdana
}
</STYLE>
<META content="MSHTML 6.00.6000.16788" name=GENERATOR></HEAD>
<BODY class=hmmessage>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>Cui,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>While you need to tell Visual Studio where to find the
GDAL .h files (for compilation) and the .lib files (for
linking), it is Windows you need to tell where to find the .dll files
for running your executable.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>Since it is Windows that needs to find the dll's, setting
their address in VS doesn't help much. Windows will look for
the necessary dll's in the location of your executable (by default
\Debug and \Release, respectively), the system32 directory, or any directory
that is mentioned in your PATH variable (Control Panel - System - Advanced -
Environment Variables). Any other computer running your program must also have
the GDAL dll's either together with the executable, in System32, or in a PATH'ed
location.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>With the PATH option, you can choose to extend the PATH
variable either for yourself only, or for all users (System variables). I am
never sure if a PATH update is effective until I've had the computer restarted.
If you choose to keep the dll's with your executable, you'll need to copy them
to both the debug and the release location. If you have the fwtools version of
GDAL, this will typically be some 20 dll's.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>There is no need to put the .lib (or .h) files in System32 or a
PATH folder.</FONT></SPAN></DIV><FONT face=Arial color=#0000ff></FONT>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>(By the way - if the GDAL library is something you use in
several VS projects, it's easier to store the .h and .lib locations under
Tools-Options-Projects and solutions-VC++ Directories, where the settings are
not specific to configuration, project or solution. </FONT></SPAN><SPAN
class=324154214-08012009><FONT face=Arial color=#0000ff>Only if you have both
debug and release versions of GDAL it'll be necessary to use configuration
specific .lib and .dll files. But this is the part of the problem you've already
solved).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>Good luck!<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff>Sjur K :-)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=324154214-08012009><FONT face=Arial
color=#0000ff><BR> </DIV>
<P dir=ltr align=left><FONT size=2>Sjur Kolberg<BR>SINTEF Energiforskning
A/S<BR>Sem Sælands vei 11<BR>7465 Trondheim<BR>tlf. 73 59 72 78<BR>fax 73
59 72 50 </FONT></P></FONT></SPAN><FONT face=Arial color=#0000ff></FONT><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> gdal-dev-bounces@lists.osgeo.org
[mailto:gdal-dev-bounces@lists.osgeo.org] <B>On Behalf Of </B>chen
cui<BR><B>Sent:</B> 8 januar 2009 13:47<BR><B>To:</B>
gdal-dev@lists.osgeo.org<BR><B>Subject:</B> [gdal-dev] used the GDAL/GEOS
libraries (.dll and .lib) in my visual studio .net C++
project<BR></FONT><BR></DIV>
<DIV></DIV>Hello,<BR>I have successfully used the GDAL/GEOS libraries (.dll
and .lib) in my VC++ project. <BR>I just set the directory of where the gdal
libraries are saved under the project property setting page - Additional
Library Directories' and include directories. But when i run the debugging
mode of my project,<BR>the libraries are not found: gdal15.dll,
geos_c.dll,geos_c_fw.dll even those files are saved under the library
directory. After i copied those file into Windows/system32, then it worked
well. <BR>Is there any other way to solve this problem without saving the .dll
files in the directory windows/system32?<BR>my computer operation system is
windowsxp.<BR>thank you for your kind help!<BR> <BR>best
regards!<BR> <BR>Cui<RTE_TEXT></RTE_TEXT><BR><BR>
<HR>
check out the rest of the Windows Live™. More than mail–Windows Live™ goes way
beyond your inbox. <A href="http://www.microsoft.com/windows/windowslive/"
target=_new>More than messages</A> </BLOCKQUOTE></BODY></HTML>