Opened 15 years ago
Closed 15 years ago
#3148 closed defect (fixed)
Patch to make frmts/gtiff/tifvsi.cpp compile under VC++ 9.0
Reported by: | aknuds1 | Owned by: | chaitanya |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | default | Version: | 1.6.2 |
Severity: | major | Keywords: | Visual C++ |
Cc: | arve.knudsen@…, warmerdam, Mateusz Łoskot |
Description
GDAL 1.6.2 doesn't currently compile under VC++ 9.0 just due to the order of a couple of header inclusions in frmts/gtiff/tifvsi.cpp. The attached patch rectifies this.
Attachments (1)
Change History (9)
by , 15 years ago
Attachment: | tifvsi.diff added |
---|
comment:1 by , 15 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Chaitanya,
Could you apply this after review in trunk at least and perhaps 1.6 too if it seems safe enough.
comment:2 by , 15 years ago
Status: | new → assigned |
---|
aknuds1,
There was no problem with tifvsi.cpp in the buildbot or my machine.
Can you provide the error message and tell me how you reached this solution?
comment:3 by , 15 years ago
This is the error I get:
cl /nologo /MD /EHsc /Ox /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG -I..\..\port -I..\. .\ogr -I..\..\gcore -I..\..\alg -I..\..\ogr\ogrsf_frmts -DBIGTIFF_SUPPORT -I\Devel\tiff-3.8.2-1-src\tiff-3.8.2-src\libt iff -Ilibgeotiff -DOGR_ENABLED /c tifvsi.cpp tifvsi.cpp C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\swprintf.inl(41) : error C2664: '_vswprintf_c_l' : cannot convert parameter 4 from 'void *' to '_locale_t'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\swprintf.inl(51) : error C2664: '_vswprintf_c_l' : cannot convert parameter 4 from 'void *' to '_locale_t'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
I don't quite remember how we arrived at the solution, but I believe that tiffio.h somehow redefines NULL to "(void *)0".
comment:4 by , 15 years ago
Cc: | added |
---|
Matheuz,
Could you comment on this? I think I got this (or a similar) error message with my Visual Studio too. However, this was not the solution I used. I just started with a fresh copy of the whole gdal directory. I believe the problem was with the project settings being corrupted.
I googled this problem. This had solutions like (1) installing the VS's Service Pack (http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/ff75f279-d77f-497c-bd60-838495de905a/), (2) correcting the VS's PATH and other variables, and (3) rearranging the header files as described in this ticket.
comment:5 by , 15 years ago
Chaitanya,
The GTiff driver compiles for me with libtiff 3.9.1 using Visual C++ 9.0 (SP1 included), so I'm not able to reproduce the problem. However, from what I can see, the fix looks pretty safe and if it is confirmed it works, I'd apply it.
The problem may be with different definitions of NULL macro in 3rd-party C libraries (it's safer to stick to plain Zero, not NULL name).
comment:7 by , 15 years ago
@aknuds1 A side note: You can build GDAL using nmake from command line or you can use makegdal80.vcproj which in fact is equivalent to calling nmake from command line - no difference.
The difference would be if you use your own .vcproj file that does not forward calls to nmake.
comment:8 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fix tifvsi.cpp compilation under VC++