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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Michael Müller
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

_______________________________________________
Liblas-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/liblas-devel
Loading...