Eigen 库和 c++ 的问题连接器

发布于 2024-10-07 04:36:53 字数 1137 浏览 1 评论 0原文

我尝试将我的 C++ 应用程序链接到“Eigen 2.0.15”库。 一些细节:

  • 我的编译器是:gcc 版本 4.0.1 (Apple Inc. build 5493)
  • 我的操作系统是:mac os 10.5
  • 我用 g++ -I/opt/local/include -I/opt/local/ 编译代码包括/eigen2 -O2 -g ...

    构建目标:LBRALL 调用:MacOS X C++ 链接器 g++ -L/opt/local/lib -o "LBRALL" [... *.o -files ] -lcv -lEigen2 -lcxcore -lhighgui

错误是:

`Undefined symbols:
"Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<float, 4, 4, 2, 4, 4>, 3, 3, 1, 32>    >::inverse() const", referenced from:
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRSendStateCart.o
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRCam.o
"Eigen::MatrixBase<Eigen::Matrix<float, 4, 4, 2, 4, 4> >::inverse() const", referenced from:
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRSendStateCart.o
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRCam.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [LBRALL] Error 1`

有人知道链接器失败的原因吗?

I try to link my c++ application against the "Eigen 2.0.15" library.
Some details:

  • My compiler is: gcc version 4.0.1 (Apple Inc. build 5493)
  • My OS is: mac os 10.5
  • I compile the code with g++ -I/opt/local/include -I/opt/local/include/eigen2 -O2 -g ...

    Building target: LBRALL
    Invoking: MacOS X C++ Linker
    g++ -L/opt/local/lib -o "LBRALL" [... *.o -files ] -lcv -lEigen2 -lcxcore -lhighgui

The error is:

`Undefined symbols:
"Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<float, 4, 4, 2, 4, 4>, 3, 3, 1, 32>    >::inverse() const", referenced from:
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRSendStateCart.o
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRCam.o
"Eigen::MatrixBase<Eigen::Matrix<float, 4, 4, 2, 4, 4> >::inverse() const", referenced from:
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRSendStateCart.o
  Eigen::Transform<float, 3>::inverse(Eigen::TransformTraits) constin LBRCam.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [LBRALL] Error 1`

Does anybody have an idea why the linker fails?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

℡寂寞咖啡 2024-10-14 04:36:53

查看错误消息,我猜您没有实例化 Matrix、Transform 和可能的其他模板。发生这种情况可能是因为头文件不包含这些模板的实现,或者可能有一个条件编译应该为它们提取实现。

Looking at the error messages, my guess you didn't instantiate Matrix, Transform and possibly other templates. That happened probably because the header files didn't contain implementation of those templates, or maybe there is a conditional compilation that is supposed to pull up implementation for them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文