[Liblas-devel] Unhandled exception at 0x74A4D9A7 (msvcp90.dll)

Michael Müller michael.mueller.berlin at gmail.com
Mon May 12 05:26:24 PDT 2014


Hi

although I have not that much experience with MS Visual Studio and C++ in
general I try to write a litte tool to calculate some things out of
las-files. I already built liblas (like it is described in the tutorial
'Compilation')...after that I wanted to run one of the given examples
(copying a las-file or just reading the header information).

But I keep on getting the following error in line "liblas::Reader reader =
f.CreateWithStream(ifs);":
Unhandled exception at 0x74A4D9A7 (msvcp90.dll) in las2prof.exe:
0xC0000005: Access violation reading location 0x00000000.

The code is:

#include "stdafx.h"
#include <liblas/liblas.hpp>
#include <fstream>  // std::ifstream
#include <iostream> // std::cout

int main()
{
    std::ifstream ifs;
    ifs.open("D:\\libLAS-1.7.0\\test\\data\\1.2-with-color.las",
std::ios::in | std::ios::binary);

    liblas::ReaderFactory f;
    liblas::Reader reader = f.CreateWithStream(ifs);

    const liblas::Header& header = reader.GetHeader();

    std::cout << "Compressed: " << (header.Compressed() == true) ?
"true":"false";
    std::cout << "Signature: " << header.GetFileSignature() << '\n';
    std::cout << "Points count: " << header.GetPointRecordsCount() << '\n';

}

Any ideas on how to fix this?
Thanks in advance
Michael Mueller
Berlin, Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/liblas-devel/attachments/20140512/20058355/attachment.html>


More information about the Liblas-devel mailing list