Home > Back-end >  Using mysql error
Using mysql error

Time:11-29

 
#include
#include
#include
using namespace std;
Using the namespace mysqlpp;
Int main ()
{
The Connection conn (false);
If (conn. Connect (" test1 ", "127.0.0.1", "root", "root"))
{
Query Query=conn. Query (" select cust_id from customers ");
StoreQueryResult res=query. Store ();
For (size_t I=0; I & lt; Res. Num_rows (); I++)
{
Cout & lt; }
}
The else
{
return -1;
}
return 0;
}

With GDB to debug, step to 12: Query Query=conn. Query (" select cust_id from customers "); Times wrong
 
The Program received signal SIGSEGV, Segmentation fault.
0 x00007ffff73c0f1f in STD: : __use_cache & lt; STD: : __numpunct_cache & lt; char> : : operator () (this=& lt; Optimized out> , __loc=... )
The at/usr/local/GCC - 9.3.0/build/x86_64 - PC - - the gnu/Linux libstdc++ - v3/include/bits/locale_facets. TCC: 53
53/usr/local/GCC - 9.3.0/build/x86_64 - PC - - the gnu/Linux libstdc++ - v3/include/bits/locale_facets. TCC: don't have that file or directory.

But the/usr/local/GCC - 9.3.0/build/x86_64 - PC - - the gnu/Linux libstdc++ - v3/include/bits/locale_facets. TCC file exists,
Who met this kind of situation? How to solve?
  • Related