|
|
|
|
|||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
"undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'"
My code:
// Database stuffs. mysqlpp::Connection awi_mysql_conn(false); // Vars for the command line. TCLAP::ValueArg<char*awi_tclap_mysql_pwd("p","mysql_pwd","MySQL Password",true,"admin","string"); TCLAP::ValueArg<char*awi_tclap_mysql_usr("u","mysql_usr","MySQL User",true,"root","string"); TCLAP::ValueArg<char*awi_tclap_mysql_db("d","mysql_db","MySQL Database",true,"awi","string"); TCLAP::ValueArg<char*awi_tclap_mysql_srv("s","mysql_srv","MySQL Server",true,"locahost","string"); TCLAP::SwitchArg awi_tclap_open_mode("o","open_mode","Use Mode",false); // Stuffs for the system command line. Not the internal CLI. TCLAP::CmdLine awi_cmd("Artifitical World Intelligence",' ',awi_version,true); // Send the arguments to TCLAP. awi_cmd.add(awi_tclap_mysql_pwd); awi_cmd.add(awi_tclap_mysql_usr); awi_cmd.add(awi_tclap_mysql_db); awi_cmd.add(awi_tclap_mysql_srv); awi_cmd.add(awi_tclap_open_mode); // Parse the command line. awi_cmd.parse(argc,argv); // Get values. char* awi_mysql_db = awi_tclap_mysql_db.getValue(); char* awi_mysql_srv = awi_tclap_mysql_srv.getValue(); char* awi_mysql_usr = awi_tclap_mysql_usr.getValue(); char* awi_mysql_pwd = awi_tclap_mysql_pwd.getValue(); bool awi_open_mode = awi_tclap_open_mode.getValue(); // Connect to the database using command line values. > if(awi_mysql_conn.connect(awi_mysql_db,awi_mysql_s rv,awi_mysql_usr,awi_mysql_pwd)){ std::cout << "Database connection successful." << endl; }else{ std::cout << "ERRR: Unable to connect to database." << endl; exit(EXIT_FAILURE); }; > The error: Main.cpp:(.text+0x16e9): undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)' Does anyone have just the slightest idea what I'm doing wrong? My compiler command is: g++ \ -I./lib/MySQLPP -I./lib/TCLAP -I./lib/Miscellaneous \ `mysql_config ` `mysql_config ` `mysql_config ` \ -lmysqlpp -lpthread -lnsl -lresolv \ ./src/Main.cpp -o ./bin/AWIWorldServer; > To me this seems all good Any ideas? Thanks. |
![]() |
| Viewing: Web Development Archives > Mailing Lists > MYSQL > "undefined reference to `mysqlpp::Connection::connect(char const*, char const*, char const*, char const*, unsigned int)'" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|