Hello,
trying to compile a simpliest project with mysql support:
compile with g++:
compile with c++:
in addition:
trying to compile a simpliest project with mysql support:
C++:
#include <iostream>
using namespace std;
int main(){
cout << "Hello world" << endl;
return 0;
}
compile with g++:
$g++ main.cpp -Wall -std=c++11 -lmysqlcppconn -o mysql-test
$ ./mysql-test
Segmentation fault (core dumped)
compile with c++:
$ c++ main.cpp -Wall -std=c++11 -lmysqlcppconn -o mysql-test
...
/usr/bin/ld: cannot find -lmysqlcppconn
in addition:
$ ll /usr/local/include/mysql*.h
-rw-r--r-- 1 root wheel uarch 5460 May 10 2017 /usr/local/include/mysql_connection.h
-rw-r--r-- 1 root wheel uarch 2825 May 10 2017 /usr/local/include/mysql_driver.h
-rw-r--r-- 1 root wheel uarch 1562 May 10 2017 /usr/local/include/mysql_error.h
$ pkg info | grep mysql
mysql-connector-c++-1.1.9_5 MySQL database connector for C++
mysql57-client-5.7.23 Multithreaded SQL database (client)
mysql57-server-5.7.23 Multithreaded SQL database (server)