[Gdal-dev] environment variable problem in Visual Studio .NET 2003

David Lugan davidlugan at hotmail.com
Thu Feb 26 23:33:12 EST 2004


Hello GDAL-dev,

The setenv and putenv have a bug in Visual Studio .NET 2003.  Anyone else 
have problems with this?


My program calls _putenv("PROJ_LIB=C:\NAD"); so GDAL can use PROJ.DLL to 
warp properly

When I work in Visual Studio .NET (2002) my program works great

After installing Visual Studio .NET 2003 Pro my program only warps correctly 
sometimes



MY SOLUTION THAT WORKS:

Remove ALL putenv and getenv calls from the GDAL ( gdal-1.2.0a5 ) and PROJ4 
( proj-4.4.7 ) source code.



According to Tian Min Huang (timhuang at online.microsoft.com):

"the problem is caused by some versions of Multithreaded DLL C run-time 
libary"



See "Crash in C runtime library on Windows XP" from Google Groups:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=16b5514dd08e1c7f&rnum=1



David Lugan

_________________________________________________________________
Find and compare great deals on Broadband access at the MSN High-Speed 
Marketplace. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/




More information about the Gdal-dev mailing list