Bug #90727 Linking errors for missing mysql_sys and mysql_strings libraries
Submitted: 3 May 2018 5:51 Modified: 1 Jun 2018 18:09
Reporter: Georgi Sotirov Email Updates:
Status: Closed Impact on me:
Category:Connector / C++ Severity:S3 (Non-critical)
Version:1.1.11 OS:Linux (Slackware 14.2)
Assigned to: CPU Architecture:x86

[3 May 2018 5:51] Georgi Sotirov
I get the following linking errors when trying to build MySQL Connector/C++ 1.1.11 from source with dynamic linking:

ld: cannot find -lmysql_sys
ld: cannot find -lmysql_strings

These are due to following lines in FindMySQL.cmake file:

   list(APPEND SYS_LIBRARIES "mysql_sys")
   list(APPEND SYS_LIBRARIES "mysql_strings")

which came from commit 2e38a29 (see https://github.com/mysql/mysql-connector-cpp/commit/2e38a29d55084a84fb784e548130f25b985aed... ) by silvakid. I also commented in GitHub.

How to repeat:
1. Download MySQL Connector/C++ from https://dev.mysql.com/get/Downloads/Connector-C++/mysql-connector-c++-1.1.11.tar.gz
2. Uncompress and configure with 

cmake . -LA \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_CXX_COMPILER=/usr/bin/g++ \
      -DCMAKE_CXX_FLAGS="-O3" \
      -DMYSQL_CXXFLAGS="$MYSQL_CXXFLAGS -fexceptions" \
      -DCMAKE_C_COMPILER=/usr/bin/gcc \
      -DCMAKE_C_FLAGS="-O3" \
      -DCMAKE_INSTALL_DOCDIR=/usr/doc/mysql-connector-c++-1.1.11 \
      -DCMAKE_INSTALL_LIBDIR=/usr/lib \

3. Try to make with

make -j VERBOSE=1

4. Linker errors mentioned in description appear and break the build.

Suggested fix:
The lines commented in description should be either made Solaris specific or removed, because for building under Linux they're not necessary.
[3 May 2018 9:42] Chiranjeevi Battula
Hello Georgi Sotirov,

Thank you for the bug report.
Verified based on internal discussion with dev's.

[1 Jun 2018 18:09] Paul DuBois
Posted by developer:
Fixed in 1.1.12.

Compiling Connector/C++ from source using dynamic linking resulted in
link errors for the mysql_sys and mysql_strings libraries.