ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Rep:
Linux "header only" library to connect to mysql
Is there a header only code I can include in my program to make it possible to connect and interact with mysql? I hate dealing with dependencies and shared libs, it's always a nightmare as from system to system you never know what issues you'll run into at compile or run time. I just want something that is purely code, no libs, and that just works and I just include in my program so that my program can be dropped on any machine and compile and work with no issues.
I'm even thinking of writing my own if such thing does not exist, I'd have to find some specs on how the protocol works at the tcp/ip level though.
I'm trying to get mysql++ to work with a program on my server and since I migrated to a new server it just refuses to work properly. I just hate dealing with shared libs and wasting time getting them to work, I just want to get to coding. So is there such library out there that is strictly a header that I can include? If not, where can I find info on the mysql protocol so I can write my own?
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336
Original Poster
Rep:
I've been trying to figure out how to do that but so far no luck. When I bring the binary on another system it's still looking for the libraries to be at a very specific spot.
ex:
Code:
./uogpoller: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
This is the string I'm using, is there a better way?
you need the static versions of the libraries installed on the build machine (the .a files which usually come with the -dev package that provides the headers) and you need to use the -static option.
So am I out of luck for that specific lib? Can I just copy it over to the other system to the same location or is that going to cause issues? It does exist on the other system but it's not at the same place, which is often the cause of issues with this whole shard library thing. It would be nice if there was a standard place for them.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.