MySQL Forums
Forum List  »  Connector/C++

Re: Static linking to Connector/C++ on linux giving errors
Posted by: Pelle Stormark
Date: April 15, 2020 10:20AM

On my machine it's placed there by default. It also says in the official documentation to use the file in that folder in the installation directory. A line from the makefile in the documentation:

LDLIBS = $(MYSQL_CONCPP_DIR)/lib64/libmysqlcppconn8-static.a -lssl -lcrypto -lpthread

When I downloaded the connector I got both a lib64 and an include folder, and those are referenced like this in the example of dynamic linking in their documentation:

CPPFLAGS = -I $(MYSQL_CONCPP_DIR)/include -L $(MYSQL_CONCPP_DIR)/lib64

Since downloading the connector gives you both these folder with all the respective files in them, it seemed obvious to use them. However, that was a mistake. I found there was a different libmysqlcppconn8-static.a in the folder you linked to, and linking to that fixed my problem. I also had to upgrade the packages further after I thought I had fixed it all because I got a connection refused error. There had been a change in MySQL I wasn't aware of. I luckily got that fixed too, after some hours of searching the net.

They should fix their documentation, because this is extremely confusing. Maybe it's just me.

Thank you for all your help. You saved my week.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Static linking to Connector/C++ on linux giving errors
201
April 15, 2020 10:20AM


Sorry, only registered users may post in this forum.

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.