1

I understand what an unresolved symbol error is, but I don't understand why I'm getting it in this particular situation with this particular library. Here is the output of the error.

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)

Note that I am using the following link flags:

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

Note also that references to other symbols (e.g., the soci::session constructor and destructor) are being resolved.

What am I doing wrong? Is there another soci library that I should also be linking against?

EDIT: Note that I am working on Mac OS X, and have tried both the installation through homebrew (via brew install soci --with-pg), and the standalone installations of 3.2.2 and 3.2.1.

magnus
  • 4,031
  • 7
  • 26
  • 48

1 Answers1

0

I don't know why this solved the error, but changing from libc++ to libstdc++ resolved it.

magnus
  • 4,031
  • 7
  • 26
  • 48