[CONC-450] undefined reference to `mysql_init' Created: 2019-12-22 Updated: 2019-12-23 Resolved: 2019-12-23 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Perry Winkel | Assignee: | Georg Richter |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 18.04 |
||
| Description |
|
I have the most recent package: The following program: #include <iostream> when compiled with g++ -I/usr/include/mariadb -I/usr/include/mariadb/mysql -L/usr/lib/x86_64-linux-gnu/ -lmariadb -lz -ldl -lm -lpthread my.cpp gives the error: /tmp/cchC9TlH.o: In function `main': |
| Comments |
| Comment by Georg Richter [ 2019-12-22 ] | ||
|
Are you sure that you're using MariaDB Connector/C and if yes, how did you install it? | ||
| Comment by Perry Winkel [ 2019-12-22 ] | ||
|
I installed it using: sudo apt install mariadb-server What I got was | ||
| Comment by Georg Richter [ 2019-12-23 ] | ||
|
Can you please also tell me the output of
| ||
| Comment by Perry Winkel [ 2019-12-23 ] | ||
|
btw, thanks for your comments so far za@mbp-2008:~$ mariadb_config --cflags | ||
| Comment by Georg Richter [ 2019-12-23 ] | ||
|
Just tested it with ubuntu packages and it worked as expected after fixing your build command: (compile first, then link):
or for newer versions of Connector/C
| ||
| Comment by Perry Winkel [ 2019-12-23 ] | ||
|
thanks for for your comment, my configuration gives the following: za@mbp-2008:~$ g++ -o mytest my.cpp `mariadb_config --cflags --libs` | ||
| Comment by Perry Winkel [ 2019-12-23 ] | ||
|
I installed the mariadb tarball from https://downloads.mariadb.org/mariadb/10.4.11/ Now I can use mysql_config and everything compiles ok! Again thank you Georg for thinking with me. I very much appreciate that. I hope this thread will be of any assistance to others who face the same troubles. Perry |