[Liblas-devel] Why las2ogr based on OGR C API?

Mateusz Loskot mateusz at loskot.net
Fri May 16 17:27:10 EDT 2008


On May 16, 2008, at 11:02 PM, martin User wrote:
>>> It was including OGR private headers <ogr_p.h> causing it to not
>>> compile when --with-gdal was specified. OGR's C++ API is kind of a
>>> mess when it comes to installation and I think most folks who use
>>> the OGR C++ API do static linking.
>>
>> OK, the linking reason makes sense to me.
>> So, let's move to C API.
>>
>
> C++ Portability Guide
> http://developer.mozilla.org/en/docs/C%2B%2B_Portability_Guide



Margin,

I'm sorry, but have you checked the last date of update of this  
document?

This document should be considered as out of date and actually it is  
also by many Mozilla folks, considering status of C++ compilers today.  
Look at the Sutter's books listed at best C++ practices [1]. These  
writings stay completely in contradiction with what the guide says.

Finally, Mozilla is officially supported on +-28 operating systems and  
it is  said to be compilable with oldies from 1998 like Visual C++ 6.0  
(which never was a C++ compiler, but only named that way for marketing  
purposes).
And that's the reason they use only a subset of C++ language.  
Actually, it's a "C with classes".

In libLAS, we have agreed to use C++ (but not C with classes) and to  
officially *not* to support old compilers like Visual C++ 6.0/7.0.
IMHO, this is a perfectly valid approach.

The issues Howard is referring to are caused by GDAL/OGR library
which - similarly to Mozilla - has to be supported on very old toolsets.
And, this is valid approach as well, if intentionally and officially  
defined.

In case we want to link libLAS to GDAL, we need to use GDAL's portable  
option, means C API.


[1] http://www.mozilla.org/hacking/best-cpp-practices.html

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org







More information about the Liblas-devel mailing list