Since mysql-connector-c++ 1.1.4 has been available for a few months I am trying to create a PKGBUILD for this version. The first problem I encountered was the MYSQL_LIB variable set to NOTFOUND by default. I circumvented this issue by hardcoding -DMYSQL_LIB=/usr/lib/libmysqlclient.so in my PKGBUILD . However, I don't think this is the right solution. Does anyone know how to obtain the location of this library and pass it to cmake correctly?
After this workaround make begins to build the library, but errors when linking an object file:
[ 47%] Building CXX object test/framework/CMakeFiles/test_framework.dir/start_options.cpp.o Linking CXX executable driver_test ../driver/libmysqlcppconn.so.220.127.116.11: undefined reference to `mysql_options4' collect2: error: ld returned 1 exit status
When viewing the symbols in libmysqlcppconn.so.18.104.22.168 (using readelf) I noticed that mysql_options4 is indeed available, but with an undefined index. So I searched for this error and found some info about undefined symbols, but not about this particular case or anything that could be related. Does anyone know how to solve this issue?
I thought that it might be because I have libmariadbclient 10.0.13-1 installed and tried to build the connector against Oracle's libmysqlclient from AUR. This time, I got a different error:
/…/src/mysql-connector-c++-1.1.4/driver/mysql_metadata.cpp:1216:74: error: ‘dynamic_cast’ not permitted with -fno-rtti connection(dynamic_cast< MySQL_Connection * >(service->getConnection())), ^
So somehow I should remove this flag from the compiler command line make uses.
However, as mariadb is now default in Arch, I think we should try to build mysql-connector-c++ against that.