Hi all,
I have been trying to compile the PostgreSQL plugins on Ubuntu 16.04.1 and I am getting an error during the linking phase that has to do with libiconv. Specifically, "Undefined reference to 'libiconv'" generated while linking a boost file. Here is the message:
Linking CXX shared library libOrthancPostgreSQLStorage.so
CMakeFiles/OrthancPostgreSQLStorage.dir/boost_1_59_0/libs/locale/src/encoding/codepage.cpp.o: In function `boost::locale::call_iconv(void*, char**, unsigned long*, char**, unsigned long*)':
codepage.cpp:(.text._ZN5boost6locale10call_iconvEPvPPcPmS3_S4_[_ZN5boost6locale10call_iconvEPvPPcPmS3_S4_]+0x3c): undefined reference to `libiconv'
CMakeFiles/OrthancPostgreSQLStorage.dir/boost_1_59_0/libs/locale/src/encoding/codepage.cpp.o: In function `boost::locale::conv::impl::iconverter_base::open(char const*, char const*, boost::locale::conv::method_type)':
codepage.cpp:(.text._ZN5boost6locale4conv4impl15iconverter_base4openEPKcS5_NS1_11method_typeE[_ZN5boost6locale4conv4impl15iconverter_base4openEPKcS5_NS1_11method_typeE]+0x32): undefined reference to `libiconv_open'
CMakeFiles/OrthancPostgreSQLStorage.dir/boost_1_59_0/libs/locale/src/encoding/codepage.cpp.o: In function `boost::locale::conv::impl::iconverter_base::close()':
codepage.cpp:(.text._ZN5boost6locale4conv4impl15iconverter_base5closeEv[_ZN5boost6locale4conv4impl15iconverter_base5closeEv]+0x26): undefined reference to `libiconv_close'
collect2: error: ld returned 1 exit status
CMakeFiles/OrthancPostgreSQLStorage.dir/build.make:1056: recipe for target 'libOrthancPostgreSQLStorage.so.2.0' failed
make[2]: *** [libOrthancPostgreSQLStorage.so.2.0] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/OrthancPostgreSQLStorage.dir/all' failed
make[1]: *** [CMakeFiles/OrthancPostgreSQLStorage.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
I'm guessing this could be solved by installing the libiconv library and linking to it, however I am running into another set of compiler errors with that installation. So, two questions:
1. Is there a more straightforward way to get a hold of a PostgreSQL plugin that is compatible with Ubuntu 16.04.1?
2. If not, do you have any tips for installing libiconv or otherwise resolving this linker error?
Thanks!