[Liblas-devel] c liblas problem

Black, Michael (IS) Michael.Black2 at ngc.com
Wed Oct 28 15:59:58 EDT 2009


Well -- this little program compiles just fine with "cc -o myprog myprog.c -llas"
Examining liblas.a I see both C and C++ routines in there.
Am I missing something?
 
#include<stdio.h>
#include "liblas/capi/liblas.h"
int main(int argc, char** argv)
{
 int i;
 LASReaderH reader = LASReader_Create(argv[1]);
 LASHeaderH header = LASReader_GetHeader(reader);
 int count=LASHeader_GetPointRecordsCount(header);
 LASPointH point;
 for(i=0;i<count;i++) {
        double x,y,z;
        point = LASReader_GetNextPoint(reader);
        x = LASPoint_GetX(point);
        y = LASPoint_GetY(point);
        z = LASPoint_GetZ(point);
        printf("%f %f %f\n",x,y,z);
 }
 LASReader_Destroy(reader);
 return 0;
}

 
Michael D. Black
Senior Scientist
Northrop Grumman Mission Systems
 

________________________________

From: Mateusz Loskot [mailto:mateusz at loskot.net]
Sent: Wed 10/28/2009 2:49 PM
To: Black, Michael (IS)
Cc: Riki Tiki; liblas-devel at lists.osgeo.org
Subject: Re: [Liblas-devel] c liblas problem



Black, Michael (IS) wrote:
> I already communicated with Riki and solved his problem.

OK, thanks.

> He's running Linux
> 
> cc -o myprog mprog.c -llas

Yes, this command is not enough.
This links only against C++ API, but C API is a separate library.

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/liblas-devel/attachments/20091028/d0c274f8/attachment-0001.html


More information about the Liblas-devel mailing list