MySQL Forums
Forum List  »  Connector/C++

MySQL sample test with C++ get build problem
Posted by: tom tom
Date: April 09, 2023 04:54AM

1. I use winddow 10 , vs2002 C++ ,MySQL community 8.0.32, Connector C++8.0.32
2. the vsc++ and mySQL seemed already linked successful, because I can query or insert record with vsc++ in mySQL with SQL session.

3.When I test the sample code in page 6 ,in "X DevAPI User Guide" , there is alway build problem happened :

#include <iostream>
#include <string>
#include <mysqlx/xdevapi.h>
using namespace std;
using namespace mysqlx;

int main()
Session mySession("localhost", 33060, "root", "passwd");

Schema db = mySession.getSchema("sakila");
Collection act = db.getCollection("actor"); // get table info
DocResult res = act.find("first_name like :param")//RowResult
.bind("param", "L%").execute();
cout << res.fetchOne();

above is my code try to select data from sample database "sakil",tabel "actor".

build stop in header file "xdevapi.h" ,said "abnormal unhandled" in
: Session(SessionSettings(options...))

i don't know how to do , very appreciate for your help

Options: ReplyQuote

Written By
MySQL sample test with C++ get build problem
April 09, 2023 04:54AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.