Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

MySQL sample test with C++ get build problem (no replies)

$
0
0
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
.limit(1)
.bind("param", "L%").execute();
cout << res.fetchOne();
mySession.close();
}

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
template<typename...T>
Session(T...options)
try
: Session(SessionSettings(options...))
{}CATCH_AND_WRAP


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

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>