【问题标题】:Unresolved symbol error with the soci librarysoci 库中未解决的符号错误
【发布时间】:2014-04-14 00:50:52
【问题描述】:

我明白什么是未解决的符号错误,但我不明白为什么我会在这个特定库的这种特殊情况下得到它。这是错误的输出。

Undefined symbols for architecture x86_64:
  "soci::soci_error::soci_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      soci::type_conversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void>::from_base(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, soci::indicator, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in Inspector.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请注意,我正在使用以下链接标志:

-L/usr/local/lib -lsoci_core -lsoci_postgresql -lpq -ldl

另请注意,正在解析对其他符号的引用(例如,soci::session 构造函数和析构函数)。

我做错了什么?还有其他我应该链接的社会图书馆吗?

编辑:请注意,我正在使用 Mac OS X,并且尝试过通过自制软件(通过 brew install soci --with-pg)进行安装,以及 3.2.2 和 3.2.1 的独立安装。

【问题讨论】:

    标签: c++ postgresql linker shared-libraries soci


    【解决方案1】:

    我不知道为什么这解决了错误,但是从 libc++ 更改为 libstdc++ 解决了它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-23
      • 2012-03-20
      • 2023-03-05
      • 2011-09-03
      • 2010-11-20
      • 2021-10-30
      • 2014-05-12
      相关资源
      最近更新 更多