<div dir="ltr"><div><div><div><div><div><div>Hi<br><br></div>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).<br>
<br></div>But I keep on getting the following error in line "liblas::Reader reader = f.CreateWithStream(ifs);":<br>Unhandled exception at 0x74A4D9A7 (msvcp90.dll) in las2prof.exe: 0xC0000005: Access violation reading location 0x00000000.<br>
<br></div><div>The code is:<br><br>#include "stdafx.h"<br>#include <liblas/liblas.hpp><br>#include <fstream>  // std::ifstream<br>#include <iostream> // std::cout<br><br>int main()<br>{<br>    std::ifstream ifs;<br>
    ifs.open("D:\\libLAS-1.7.0\\test\\data\\1.2-with-color.las", std::ios::in | std::ios::binary);<br><br>    liblas::ReaderFactory f;<br>    liblas::Reader reader = f.CreateWithStream(ifs);<br><br>    const liblas::Header& header = reader.GetHeader();<br>
<br>    std::cout << "Compressed: " << (header.Compressed() == true) ? "true":"false";<br>    std::cout << "Signature: " << header.GetFileSignature() << '\n';<br>
    std::cout << "Points count: " << header.GetPointRecordsCount() << '\n';<br>    <br>}<br></div><div><br></div>Any ideas on how to fix this?<br></div>Thanks in advance<br></div>Michael Mueller<br>
</div>Berlin, Germany<br></div>