0

Setup: Beagleboneblack, debian10, arm, mariadb v10.3.36.

Following this guide: https://mariadb.com/docs/connect/programming-languages/cpp/install/

I reach this step:

$ sudo install include/mariadb/* /usr/include/mariadb/

when executing the above command I get the following message; install: omitting directory 'include/mariadb/conncpp'

I ran through the rest of the Install MariaDB Connector/C++ guide, but when i try to compile my task.cpp app using:

$ g++ -o tasks tasks.cpp -std=c++11 -lmariadbcpp

following this example: https://mariadb.com/docs/connect/programming-languages/cpp/sample-app/ i get:

# g++ -o tasks task.cpp -std=c++11 -lmariadbcpp
task.cpp:3:10: fatal error: mariadb/conncpp.hpp: No such file or directory
 #include <mariadb/conncpp.hpp>

The main issue is with the -lmariadbcpp i think, its not installed in the correct place or whatever. Can someone explain to me how mariadb connector-library is installed, where it resides, and how i can use it when compiling?

It might be i can't use the c++ connector with my version of mariadb, since c++ connector requires that its a "enterprise" version of maria db. However it should be able to compile/install. Please help me understand the installation process of a library in debian? ?? :)

Update: After some struggle, it seems i can install the files by cd into the include directories and installing the files manually be explicitly using the file name. Atleast i think there is some progress now...

8
  • 1
    Check if the header file is correctly installed to /usr/include/mariadb/conncpp.hpp. Also, check whether the include paths used by g++ contain /usr/include (it should, otherwise it's not going to see the header) by appending -v to enable verbose output from the compiler. Commented Oct 22, 2022 at 16:53
  • "The main issue is with the -lmariadbcpp i think" - No, this is a linker flag and it does not affect the compiler finding headers (which is done before the linking step). Commented Oct 22, 2022 at 16:56
  • After the update, i got all files installed in the usr/lib and user/include locations (?). SO now it executes/uses the gcc. Only syntax errors in the task.cpp code remains :p
    – otk
    Commented Oct 22, 2022 at 17:28
  • Thanks kotatsuyaki Code errors cleared, when compiling i get error: /usr/lib/gcc/arm-linux-gnueabihf/8/../../../libmariadbcpp.so: file not recognized: file format not recognized collect2: error: ld returned 1 exit status Any thoughts?
    – otk
    Commented Oct 22, 2022 at 17:57
  • I found this, but i dont see how i can utilize the info from this post: stackoverflow.com/questions/69766593/…
    – otk
    Commented Oct 22, 2022 at 18:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.