Thread: [ C++ and MySQL ] How to compile ?
code:#include <iostream> #include <mysql.h> using namespace std; int main(int argc, char *argv[]) { mysql *connection; connection = mysql_init(null); mysql_real_connect(connection, "localhost", "root", "password", "test", 0, null, 0); return 0; }what i'm doing wrong ?code:g++ main.cpp -o main -l/usr/include/mysql-lmysqlclient -i/usr/include/mysql main.cpp: in function ‘int main(int, char**)’: main.cpp:8: error: ‘mysql’ not declared in scope main.cpp:8: error: ‘connection’ not declared in scope
** don't blame me source code and/or commands i've used - i'm learning , stuff comes tutorial.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [ C++ and MySQL ] How to compile ?
Ubuntu
Comments
Post a Comment