I am moving from mysql to MariaDB. With mysql I was linking the C connector to my application with mysql_config --libs, and according to what I can read on internet it should still be possible with MariaDB, but on my system mysql_config does not exist and I do not know how to get it and if the copy I will eventually get will be still compatible with MariaDB.
So the question is: how to link MariaDB to my C/C++ application?
Debian 10 (Buster) 64 bits ~
mariadb-server Version: 1:10.3.15-1 ~
mariadb-client Version: 1:10.3.15-1 ~
Thank you in advance.
Well, this is what I do:
sudo apt-get install libmariadbclient-dev
And the link command will be -lmariadbclient
To avoid naming collisions with either MySQL or MariaDB Servers prior to 10.2 (MariaDB Connector/C is bundled with Server since 10.2) MariaDB Connector/C doesn't have the mysql_config script anymore, instead of please use mariadb_config.
On my system I had installed only mariadb-server and mariadb-client, so mariadb_config was not present and mysql_config is not used anymore.
I found out that I need to install also libmariadb-dev which pulls in mariadb_config and all the headers and libs necessary to compile and link my application.
Many thanks to Georg and Sharath who gave me the right hints to find the solution.
Related
I am running an application and it throws me an error saying:
"C++ header 'string_view' is required. You need to install a newer libstdc++ on the host system."
Can someone guide me on what I need to do to get a newer version of "libstdc++" on my machine?
Thanks
Try running yum provides libstdc++ to show you what package provided the library on your system. You can then check if those packages are available for update using yum list available | grep <that package> followed by yum update <that package>.
Facing the same issue, I built gcc from source. This way you get to choose your own version. It's actually pretty straightforard -- see Building GCC at https://gcc.gnu.org/wiki/InstallingGCC.
So I have been trying to install the graph-tool module on my Ubuntu system all day now. I just cant seem to figure it out. Basically I want to use the package in jupyter notebook (in an anaconda enviroment). I followed several installation instructions, but nothing seems to work.
This for example: https://gist.github.com/dlozeve/ed59bba8bc8cb9b21e2af36cc9766938
I get to the configuration (adjusting for the fact that I am using python2.7),
./configure --prefix=/home/timo/anaconda2/envs/graph/ --with-python-module-path=/usr/local/lib/python2.7/site-packages
yielding:
configure: error: *** A compiler with support for C++14 language features is required.
Does anyone know what I might be doing wrong? Or as a simpler way to get graph-tool to work in my jupyter notebook?
Thank you very much!
The configure script is telling you exactly what is wrong: You need a compiler with C++14 support. This just means that your GCC is too old.
(You haven't told us any pertinent detail, such as the compiler version you have, library versions, etc, so we can only guess. But luckily, the configure diagnostics is crystal clear.)
A simpler way to install graph-tool would be for you to upgrade your distro (14.04 is outdated) and use the Ubuntu packages, as described here: https://git.skewed.de/count0/graph-tool/wikis/installation-instructions#debian-ubuntu
As graph-tool does not seems to run in an anaconda environment and Ubuntu 14.04 does not have support the latest C++ compiler that is needed, I did install Ubuntu 16.04 and followed firstly [https://www.google.de/amp/s/www.rosehosting.com/blog/how-to-install-jupyter-on-an-ubuntu-16-04-vps/amp/] and then finally installed graph-tool as described on the homepage.
This way I get to use jupyter notebook and am still able to import graph-tool.
Really basic issue. I'm trying to install the Datastax Cassandra C++ driver on my Ubuntu 16.0.4 machine. It really shouldn't be that difficult. I've installed all dependencies using dpkg and installed the cassandra driver deb file. But I can't find (or #include) the cassandra.h file.
Running
$ locate cassandra.h
returns nothing and running
$ locate cassandra*
returns a whole mess of files from cqlsh, the casssandra config files, etc, but no header files for the cpp driver.
Additionally, cassandra-cpp-driver doesn't show up in dpkg -l (though apt-get and dpkg -i say it's already installed).
Any help getting this installed would be appreciated.
DataStax C/C++ Driver for Apache Cassandra is currently not available from the Ubuntu official repository.
There are .deb packages for Ubuntu which are available as mentioned in the DataStax project documentation on github datastax/cpp-driver repository from this location:
http://downloads.datastax.com/cpp-driver/
If you are using Ubuntu 16.04, the last .deb available are under ubuntu/16.04/cassandra/v2.7.0/.
You will find the cassandra.h file in cassandra-cpp-driver-dev_2.7.0-1_amd64.deb, which you need to download and install with dpkg.
The suffix dev in a Debian or Ubuntu package denotes a package meant for developing programs, containing, in particular, header files.
dpkg -i cassandra-cpp-driver-dev_2.7.0-1_amd64.deb
The header will get installed in the usual location under Linux for header files that your compiler should find without a problem: /usr/include/cassandra.h.
it will also install:
/usr/lib/x86_64-linux-gnu/libcassandra_static.a
/usr/lib/x86_64-linux-gnu/pkgconfig/cassandra.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/cassandra_static.pc
/usr/share/doc/cassandra-cpp-driver-dev/changelog.Debian.gz
/usr/share/doc/cassandra-cpp-driver-dev/copyright
which you will need for static linking and for pkgconfig to work properly.
What you may have installed is cassandra-cpp-driver_2.7.0-1_amd64.deb which contains the libcassandra.so.2.7.0 that is the shared object (dynamic) library binary file,.. although whatever you installed should indeed come in the result of a dkpg -l query such as:
dpkg -l | grep cassandra
If you installed anything from an unofficial source, I would suggest you uninstall these first, and install the provided .deb for your plaform from the official source.
Follow the documentation's instructions for making your first program with this library.
I am new to x64_86, but forced to use it because RedHat dropped its 32-bit OS support in RHEL 7.x. I have to complile a lot of code, and am not ready to jump to x64 yet (because I do not need 64-bit addresses and do not want to face all related porting issues). So I have considered using -m32 and -mx32, and decided that -mx32 is the best route for me. However, while -m32 works fine on my build machine, when I use -mx32, I get this error:
In file included from /usr/include/features.h:399:0,
from /usr/include/string.h:25,
from zz.cpp:1:
/usr/include/gnu/stubs.h:13:28: fatal error: gnu/stubs-x32.h: No such file or directory
# include <gnu/stubs-x32.h>
^
compilation terminated.
I searched the web for solutions and some links indicate that I have to install some mysterious "multilib" rpms for g++ and gcc, however, I cannot find these anywhere. Others suggest that I have to install Linux in the x32 mode and build libgcc for x32, which sound extreme. Any ideas or leads? Did someone actually try g++ -mx32? Maybe it is not even supported on the RH platform... Thanks!
P.S. In order to get the "-m32" option to work I had to install:
yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686
This one fails (yum cannot find these RPMs) - allegedly these are required for -mx32 to work:
yum install gcc-multilib g++-multilib
:(
Multilib is indeed your answer, but do not know why your repo does not support it. I installed mine via apt-get:
sudo apt-get install gcc-multilib
Although it uses 64-bit instructions, it uses the 32-bit ABI so annoyingly will not run under WSL (Windows Linux subsystem), which only supports the 64-bit one.
I'm a computer science student currently running on Ubuntu 12.10 on VMware player. My assignment requires me to be using sqlite with my c++ program and I have trouble linking it with netbeans. I've read that I need libsqlite3.a to link it with my project.
I have run sudo apt-get install sqlite3 libsqlite3-dev, however I'm clueless about finding/downloading/making one. Can anyone help me with this?
That's how you list files in an installed package:
dpkg -L libsqlite3-dev
On my (Debian) system, the library is at /usr/lib/x86_64-linux-gnu/libsqlite3.a.