Opened 9 years ago

Closed 9 years ago

#5744 closed defect (fixed)

Fatal error with including <map> on Windows 7 with Visual Studio 2012 and enabled PDF

Reported by: Martin Mikita Owned by: warmerdam
Priority: normal Milestone: 1.11.2
Component: default Version: 1.11.1
Severity: normal Keywords: pdf visual studio 2012 windows fatal error map podofo
Cc:

Description

Using Visual Studio 2012 x86 or x64 native command prompt with enabled PoDoFo support results in the following fatal error:

pdfdataset.cpp
..\map : fatal error C1084: Cannot read include file: 'y:\gdal-1.11\frmts\map':
Invalid argument

... same error for pdfobject.cpp and pdfcreatecopy.cpp

Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'for' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.EXE"' : return code '0x2'
Stop.

File pdfdataset.cpp has statement #include <map> to include C++ STL map container, while in the frmts/ directory exists subdirectory map.

After renaming subdirectory map into anything else (map_) build continues (with success in pdf/ folder) until building frmts/map directory, which does not exists (it was renamed). After this step, renaming subdirectory back to the map, builds finished with success.

Change History (3)

comment:1 by Even Rouault, 9 years ago

Milestone: 1.11.2
Resolution: fixed
Status: newclosed

trunk r27988 r27989 r27990, branches/1.11 r27991 "Windows build of PDF: fix compilation issue with Visual Studio 2012 (#5744)"

comment:2 by Martin Mikita, 9 years ago

Resolution: fixed
Status: closedreopened

I am worried, it is not fixed.

Compiling x64 with PoDoFo results in:

cl /nologo /MD /EHsc /Ox /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG /W4 /wd4127 /wd4251 /wd4275 /wd4786 /wd4100 /wd4245 /wd4206 /wd4018 /wd4389 /DHAVE_SSE_AT_COMPILE_TIME -I..\port -I..\ogr -I..\gcore -I..\alg -I..\ogr\ogrsf_frmts -DOGR_ENABLED -I..\frmts -I..\alg -I..\ogr -I..\ogr\ogrsf_frmts ogr2ogr.cpp commonutils.cpp ..\gdal_i.lib /link

ogr2ogr.cpp ..\frmts\map : fatal error C1084: Cannot read include file: 'y:\gdal-1.11-latest\frmts\map': Invalid argument commonutils.cpp Generating Code... NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\cl.EXE"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\amd64\nmake.EXE"' : return code '0x2' Stop.

I just found, that file apps/ogr2ogr.cpp has #include <map>

comment:3 by Even Rouault, 9 years ago

Resolution: fixed
Status: reopenedclosed

As I can't reproduce, I'm kind of blind on that issue... Strange it has not been reported before.

trunk r27993, branches/1.11 r27994 "Complementary fix for #5744"

Please reopen if there's still an issue

Note: See TracTickets for help on using tickets.