【问题标题】:ZED Camera : undefined reference to sl::string::string()ZED 相机:未定义对 sl::string::string() 的引用
【发布时间】:2021-04-15 12:54:40
【问题描述】:

我正在尝试使用 QT 而不使用 cmake 来编译 hello zed 示例,这是我的代码:

#include <sl/Camera.hpp>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace sl;

int main(int argc, char **argv) {

    // Create a ZED camera object
    Camera zed;

    // Open the camera
    ERROR_CODE returned_state = zed.open();
    if (returned_state != ERROR_CODE::SUCCESS) {
        std::cout << "Error " << returned_state << ", exit program.\n";
        return EXIT_FAILURE;
    }

    // Get camera information (ZED serial number)
    auto camera_infos = zed.getCameraInformation();
    printf("Hello! This is my serial number: %d\n", camera_infos.serial_number);

    // Close the camera
    zed.close();
    return EXIT_SUCCESS;
}

我有太多这样的错误:

error: undefined reference to `sl::String::~String()'

我知道问题出在链接过程中,但我不知道我该怎么做

【问题讨论】:

  • 你需要展示你是如何构建你的程序的。这就是问题所在。

标签: c++ camera computer-vision


【解决方案1】:
TARGET_LINK_LIBRARIES(project_name  ${ZED_LIBS})

【讨论】:

  • 请不要只发布代码作为答案,还要解释您的代码的作用以及它如何解决问题的问题。带有解释的答案通常更有帮助,质量更高,更有可能吸引投票。
猜你喜欢
  • 2012-09-28
  • 2021-01-23
  • 1970-01-01
  • 2011-04-09
  • 1970-01-01
  • 2020-09-17
  • 1970-01-01
  • 1970-01-01
  • 2023-03-26
相关资源
最近更新 更多