[Gdal-dev] Building with Visual C++ 2005 Express

Simon Perkins sy at perkins.net
Fri Dec 30 18:44:39 EST 2005


OK, got it all to work...

The issue is explained here:

http://forums.microsoft.com/msdn/showpost.aspx?postid=15218&siteid=1

Basically, VS 2005 applications now require a manifest which basically 
specifies which version of the runtime library an executable should link 
against. This makes executables much more tightly bound to the DLL 
versions that they load. When you build the application with the visual 
C++ IDE, the manifest gets embedded inside the executable and you don't 
have to worry about it. However, for some reason, when you build using 
nmake, the manifest is produced as an additional file, with the 
extension .manifest. In order to run the executable, you have to have 
that manifest in the same directory as the executable. The problem I was 
seeing is that the GDAL makefile.vc install target doesn't copy these 
manifest files. I updated apps/makefile.vc to install the .exe.manifest 
files alongside the .exe files, and now everything works great! Ditto 
for the gdal13.dll.manifest file. I'll commit a fix to CVS shortly.

Apparently, it is possible to embed the manifest into the executable 
with a certain amount of jiggery pokery, as described here:

http://msdn2.microsoft.com/en-us/library/ms235591.aspx

Seems like a lot of work to me, so I haven't bothered implementing that. 
If anyone else feels up to it, please go ahead!

Cheers,

Sy

P.S. As I finish this, I see that Mateusz has posted something 
suggesting basically the same solution, but I'll send this anyway...

Simon Perkins wrote:

> Hi Mateusz,
>
> Thanks for the suggestions. I've followed the instructions on that 
> page and made the required changes to atlbase.h and atlwin.h, and 
> installed WTL. I then did a complete clean and rebuild of GDAL. 
> However, I get the same result as with the simple fix I reported 
> earlier: the build no longer complains about not finding atlthunk.lib, 
> but I get a strange failure to find MSVCR80.dll when trying to run any 
> of the GDAL utilities from the command line. Anybody else seen this? I 
> wonder if it is a "feature" of building win32 applications with visual 
> studio 2005 express?
>
> Cheers,
>
> Sy
>
>
> Mateusz Łoskot wrote:
>
>>On Fri, Dec 30, 2005 11:02 pm, Simon Perkins wrote:
>>  
>>
>>>Some updates. I found a suggestion on the web to simply comment out the
>>>line #pragma comment(lib, "atlthunk.lib") from the atlbase.h file (found
>>>in C:\Program Files\Microsoft Platform SDK\include\atl after you install
>>>the platform SDK).
>>>[...]>
>>>Has anyone managed to build GDAL using the express edition of Visual C++
>>>2005?
>>>
>>>    
>>>
>>
>>Have you read my last response?
>>Have you tried solution from WTL group I included in my post?
>>
>>Cheers
>>  
>>
>------------------------------------------------------------------------
>
>_______________________________________________
>Gdal-dev mailing list
>Gdal-dev at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051230/f7b426cb/attachment.html


More information about the Gdal-dev mailing list