-1

我正在尝试将 liblas 库链接到 Qt。我在 .pro 文件中使用以下代码来链接它。

    //////////////code to link liblas to Qt/////////////////////////////////   
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../OSGeo4W/lib/ -lliblas
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../OSGeo4W/lib/ -lliblas
    else:unix: LIBS += -L$$PWD/../../../../OSGeo4W/lib/ -lliblas

    INCLUDEPATH += $$PWD/../../../../OSGeo4W/include
    DEPENDPATH += $$PWD/../../../../OSGeo4W/include

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../OSGeo4W/lib/ -llaszip
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../OSGeo4W/lib/ -llaszipd
    else:unix: LIBS += -L$$PWD/../../../../OSGeo4W/lib/ -llaszip

    INCLUDEPATH += $$PWD/../../../../OSGeo4W/include
    DEPENDPATH += $$PWD/../../../../OSGeo4W/include
 ///////////////////////////////////////////////////////////////   
    and when i am running the code given below, I am getting undefined reference error
        ifstream stream;
        stream.open("lidar_sample.las", std::ios::in | std::ios::binary);
        ReaderFactory f;
        Reader reader = f.CreateWithStream(stream);
    error: undefined reference to `liblas::ReaderFactory::CreateWithStream(std::istream&)'
4

1 回答 1

0

这里只有两个可能的答案。

  1. 链接器找不到您的 liblas
  2. 您的 liblas 与您的标头版本不同。
于 2017-05-08T10:40:40.177 回答