MySQL Forums
Forum List  »  Connector/C++

Re: cmake error when using xdevapi
Posted by: Luis Silva
Date: November 21, 2022 05:55AM

Hi!

There are two different APIs for connector cpp.
JDBC, provided by this package: libmysqlcppconn9_8.0.31-1ubuntu22.04_amd64.deb
And XAPI provided by this package libmysqlcppconn8-2_8.0.31-1ubuntu22.04_amd64.deb

When you install the dev package, it will require both.

The issue is that you are linking to the wrong lib.

target_link_libraries(MySQL PUBLIC Config mysqlcppconn)

should be

target_link_libraries(MySQL PUBLIC Config mysqlcppconn8)

as you can check on the libraries dir:
/usr/lib/x86_64-linux-gnu/libmysqlcppconn.so.9.8.0.31
/usr/lib/x86_64-linux-gnu/libmysqlcppconn.so.9
/usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2.8.0.31
/usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so.2
/usr/lib/x86_64-linux-gnu/libmysqlcppconn-static.a
/usr/lib/x86_64-linux-gnu/libmysqlcppconn8-static.a
/usr/lib/x86_64-linux-gnu/libmysqlcppconn.so
/usr/lib/x86_64-linux-gnu/libmysqlcppconn8.so

So, JDBC = libmysqlcppconn.so
XAPI = libmysqlcppconn8.so

Luís

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: cmake error when using xdevapi
436
November 21, 2022 05:55AM
296
November 21, 2022 09:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.