[Liblas-devel] libLAS and VS2010

esteban70 at libero.it esteban70 at libero.it
Mon Jan 10 11:26:16 EST 2011


Finally I was able to use libLAS under VS2010.

Those are some of the problem that I had to resolve in order to use the 
library.

It is necessary to specify LAS_DLL_IMPORT in the C++ preprocessor definition 
otherwise LAS_DLL is undefined and including a libLAS .hpp causes a lot of 
errors.

This is the code in export.hpp:

#if defined(LAS_DLL_EXPORT)
#   define LAS_DLL   __declspec(dllexport)
#elif defined(LAS_DLL_IMPORT)
#   define LAS_DLL   __declspec(dllimport)

Isn't better to change the code into

#if defined(BUILD_LAS_DLL)
#   define LAS_DLL   __declspec(dllexport)
#else
#   define LAS_DLL   __declspec(dllimport)
#endif

so that if BUILD_LAS_DLL isn't defined during compilation, then it is intended 
to be used by the application?

Another problem is that libLAS doesn't compile in presence of min() and max() 
macros. Now that libLAS depends on boost maybe it can adopt the boost 
guidelines to avoid inappropriate macro substitution (http://www.boost.
org/development/requirements.html). I had to insert a lot of () and 
BOOST_PREVENT_MACRO_SUBSTITUTION to make it compile.

Hope these suggestions are correct and useful.

Frank


More information about the Liblas-devel mailing list