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

xdevapi - dynamic queries - multiple queries (no replies)

$
0
0
I'm working on converting a project from using the legacy JDBC connector to xdevapi. I know I can replicate what I'm doing right now using the session.sql classes and functions. However, I'd like to use the CRUD operations described in the documentation. That said, I can't figure out any way to create dynamic queries - ie. a select statement where I don't know how many columns will be needed at compile time. I thought perhaps I could call select("column_name") functions before doing .execute(), but that didn't work. I also considered perhaps I could use a vector of strings, but that wasn't accepted either. Any help here?

My other question, is there a way to send multiple queries to the database at once? The database is on a server, its not necessarily local, and the mysql queries are the most expensive thing the program does. Sending multiple queries at once makes things considerably more efficient, but I didn't see any documentation on that.

Thank you in advance!

mysql-connector-cpp tableinsert how to release (no replies)

$
0
0
mysqlx:: about TableInsert, use the values function add content,after execute(),
how can i release the original content to avoid duplicate insertions.

Please help. cant get connector to work, unresolved external symbol error (1 reply)

$
0
0
So, I'm at the end of my tether. I'm one week in now of trying to solve this and I think I'm going insane. Caveat: I am a bit of a noob, so could possibly be doing something stupid.
I plan to make a program to capture data on my serial port and send to my db. I thought before I do so, I would just try out a simple program using the C++ connector, this was it:

#include <mysqlx/xdevapi.h>
#include <iostream>

using namespace ::mysqlx;
using std::cout;

int main() {
cout << "Hello MySQL X DevAPI!" << std::endl;
return 0;
}


I first started out using codelite and minGW. No joy, so I switched to vs code, again, no joy. Eventually I stumbled on to a youtube video where some kind fella had posted a walkthrough. So now, I'm just trying to get his code working, using VS community 2022. I followed his method, verbatim. This is his code. Yes i know I was using mysqlx before, and I was using the correct library for that. But I'm thinking if I can just get something working, it will probably lead me to why my previous attempts failed. Here is the new code:

#include <stdlib.h>
#include <iostream>
#include "stdafx.h"

#include "mysql_connection.h"
#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/prepared_statement.h>
using namespace std;

//for demonstration only. never save your password in the code!
const string server = "tcp://yourservername.mysql.database.azure.com:3306";
const string username = "username@servername";
const string password = "yourpassword";

int main()
{
sql::Driver* driver;
sql::Connection* con;
sql::Statement* stmt;
sql::PreparedStatement* pstmt;

try
{
driver = get_driver_instance();
con = driver->connect(server, username, password);
}
catch (sql::SQLException e)
{
cout << "Could not connect to server. Error message: " << e.what() << endl;
system("pause");
exit(1);
}

//please create database "quickstartdb" ahead of time
con->setSchema("quickstartdb");

stmt = con->createStatement();
stmt->execute("DROP TABLE IF EXISTS inventory");
cout << "Finished dropping table (if existed)" << endl;
stmt->execute("CREATE TABLE inventory (id serial PRIMARY KEY, name VARCHAR(50), quantity INTEGER);");
cout << "Finished creating table" << endl;
delete stmt;

pstmt = con->prepareStatement("INSERT INTO inventory(name, quantity) VALUES(?,?)");
pstmt->setString(1, "banana");
pstmt->setInt(2, 150);
pstmt->execute();
cout << "One row inserted." << endl;

pstmt->setString(1, "orange");
pstmt->setInt(2, 154);
pstmt->execute();
cout << "One row inserted." << endl;

pstmt->setString(1, "apple");
pstmt->setInt(2, 100);
pstmt->execute();
cout << "One row inserted." << endl;

delete pstmt;
delete con;
system("pause");
return 0;

Include path is set to the JDBC folder, and the linker to the vs14 folder, mysqlcppconn-static.lib

Here is the YT tutorial I followed:
https://www.youtube.com/watch?v=a_W4zt5sR1M&list=LL&index=4&t=53s

And here is my error when I try and build the solution:

Severity Code Description Project File Line Suppression State Details
Error LNK2001 unresolved external symbol "__declspec(dllimport) void __cdecl check(class std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > const &)" (__imp_?check@@YAXAEBV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@std@@@2@@std@@@Z) mysqlProject1 C:\Users\me\Desktop\vs_workspace\mysqlProject1\mysqlProject1\main.obj 1


I would be most grateful if somebody could point me in the right direction of where I am going wrong... I'm literally worn out by it all... If I followed the walkthrough, then why do I get such errors...

Thanks

Connector/C++ 9.0.0 build failed with error (2 replies)

$
0
0
I tried to compile Connector/C++ 9.0.0 from source on Windows with cmake and the driver is failing to build with error message.

Commands I used:

cmake "C:\mysql-connector-c++-9.0.0-src" -DCMAKE_INSTALL_PREFIX="C:\mysql-connector-c++-9.0.0-install" -DWITH_JDBC=ON -DWITH_BOOST="C:\boost-1.86.0" -DWITH_MYSQL="C:\Program Files\MySQL\MySQL Server 9.0" -DWITH_SSL="C:\openssl-3.3.1-install"

cmake --build . --config Debug


And I get the following output after configure and build commands:

dinus@VivoBook-X513EP MINGW64 /c/mysql-connector-c++-9.0.0-build
$ cmake "C:\mysql-connector-c++-9.0.0-src" -DCMAKE_INSTALL_PREFIX="C:\mysql-connector-c++-9.0.0-install" -DWITH_JDBC=ON -DWITH_BOOST="C:\boost-1.86.0" -DWITH_MYSQL="C:\Program Files\MySQL\MySQL Server 9.0" -DWITH_SSL="C:\openssl-3.3.1-install"
-- Building for: Ninja
CMake Deprecation Warning at CMakeLists.txt:32 (CMAKE_POLICY):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- BIG_ENDIAN: 0
Building version 9.0.0
Building on system: Windows-10.0.22631 (AMD64)
Using cmake generator: Ninja
Using toolset:
Building 64bit code
Building shared connector library
-- Looking for SSL library.
-- Found OpenSSL: C:/openssl-3.3.1-install/lib/libcrypto.dll.a (found version "3.3.1")
-- Using OpenSSL version: 3.3.1
-- Looking for SHA512_DIGEST_LENGTH
-- Looking for SHA512_DIGEST_LENGTH - found
-- Looking for X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS
-- Looking for X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS - found
-- Looking for SSL_get0_param
-- Looking for SSL_get0_param - found
-- Looking for X509_VERIFY_PARAM_set_hostflags
-- Looking for X509_VERIFY_PARAM_set_hostflags - found
-- Looking for X509_VERIFY_PARAM_set1_host
-- Looking for X509_VERIFY_PARAM_set1_host - found
-- found required X509 extensions
CMake Deprecation Warning at cdk/CMakeLists.txt:33 (cmake_policy):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.


Configuring CDK as part of MySQL_CONCPP project
-- Setting up RapidJSON.
Skipping second declaration of config option: THROW_AS_ASSERT (found in: C:/mysql-connector-c++-9.0.0-src/cdk/CMakeLists.txt)
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of wchar_t
-- Check size of wchar_t - done
-- Setting up Protobuf.
== configuring external build of protobuf
-- sources at: C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf
-- generator: Ninja
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Windows
-- option CMAKE_SYSTEM_VERSION: 10.0.22631
-- option CMAKE_SYSTEM_PROCESSOR: AMD64
-- option CMAKE_C_COMPILER: C:/mingw64/bin/gcc.exe
-- option CMAKE_CXX_COMPILER: C:/mingw64/bin/c++.exe
-- ----
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- BIG_ENDIAN: 0
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Configuring done (1.7s)
-- Generating done (0.1s)
-- Build files have been written to: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/protobuf
== done configuring external build of protobuf
-- Setting up compression libraries.
== configuring external build of zlib
-- sources at: C:/mysql-connector-c++-9.0.0-src/cdk/extra/zlib
-- generator: Ninja
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Windows
-- option CMAKE_SYSTEM_VERSION: 10.0.22631
-- option CMAKE_SYSTEM_PROCESSOR: AMD64
-- option CMAKE_C_COMPILER: C:/mingw64/bin/gcc.exe
-- option CMAKE_CXX_COMPILER: C:/mingw64/bin/c++.exe
-- ----
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- BIG_ENDIAN: 0
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Configuring done (1.5s)
-- Generating done (0.0s)
-- Build files have been written to: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/zlib
== done configuring external build of zlib
== configuring external build of lz4
-- sources at: C:/mysql-connector-c++-9.0.0-src/cdk/extra/lz4
-- generator: Ninja
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Windows
-- option CMAKE_SYSTEM_VERSION: 10.0.22631
-- option CMAKE_SYSTEM_PROCESSOR: AMD64
-- option CMAKE_C_COMPILER: C:/mingw64/bin/gcc.exe
-- option CMAKE_CXX_COMPILER: C:/mingw64/bin/c++.exe
-- ----
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- BIG_ENDIAN: 0
-- Configuring done (0.5s)
-- Generating done (0.0s)
-- Build files have been written to: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/lz4
== done configuring external build of lz4
== configuring external build of zstd
-- sources at: C:/mysql-connector-c++-9.0.0-src/cdk/extra/zstd
-- generator: Ninja
-- option CMAKE_BUILD_TYPE: Debug
-- option CMAKE_SYSTEM_NAME: Windows
-- option CMAKE_SYSTEM_VERSION: 10.0.22631
-- option CMAKE_SYSTEM_PROCESSOR: AMD64
-- option CMAKE_C_COMPILER: C:/mingw64/bin/gcc.exe
-- option CMAKE_CXX_COMPILER: C:/mingw64/bin/c++.exe
-- ----
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/mingw64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- BIG_ENDIAN: 0
-- ZSTD_LEGACY_SUPPORT not defined!
-- Configuring done (0.9s)
-- Generating done (0.0s)
-- Build files have been written to: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/zstd
== done configuring external build of zstd
-- Looking for sys/endian.h
-- Looking for sys/endian.h - not found
-- Looking for sys/byteorder.h
-- Looking for sys/byteorder.h - not found
Wrote configuration header: C:/mysql-connector-c++-9.0.0-build/cdk/include/mysql/cdk/config.h
Legacy library soversion: 10
Looking for MySQL Client library:
version: 9.0.1
include path: C:/Program Files/MySQL/MySQL Server 9.0/include
library location: C:/Program Files/MySQL/MySQL Server 9.0/lib/libmysql.lib
dependencies search path: -LC:/Program Files/MySQL/MySQL Server 9.0/lib -LC:/Program Files/MySQL/MySQL Server 9.0/lib/private
-- Checking if MySQL client lib supports vector type - TRUE
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Check size of int8_t
-- Check size of int8_t - done
-- Check size of uint8_t
-- Check size of uint8_t - done
-- Check size of int16_t
-- Check size of int16_t - done
-- Check size of uint16_t
-- Check size of uint16_t - done
-- Check size of int32_t
-- Check size of int32_t - done
-- Check size of uint32_t
-- Check size of uint32_t - done
-- Check size of int64_t
-- Check size of int64_t - done
-- Check size of uint64_t
-- Check size of uint64_t - done
-- Check size of __int8
-- Check size of __int8 - done
-- Check size of unsigned __int8
-- Check size of unsigned __int8 - done
-- Check size of __int16
-- Check size of __int16 - done
-- Check size of unsigned __int16
-- Check size of unsigned __int16 - done
-- Check size of __int32
-- Check size of __int32 - done
-- Check size of unsigned __int32
-- Check size of unsigned __int32 - done
-- Check size of __int64
-- Check size of __int64 - done
-- Check size of unsigned __int64
-- Check size of unsigned __int64 - done
-- Looking for strtold
-- Looking for strtold - found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoul
-- Looking for strtoul - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for strtoimax
-- Looking for strtoimax - found
-- Looking for strtoumax
-- Looking for strtoumax - found
-- Using static libmysql binding
Preparing to merge SHARED library: connector-jdbc (jdbc)
Connector legacy library name: mysqlcppconn-10
-- Using cipher list defined in: C:/mysql-connector-c++-9.0.0-src/cdk/foundation/tls_ciphers.h
Preparing to merge SHARED library: connector (xapi;devapi)
Connector library name: mysqlcppconnx-2
Building version 9.0.0
Generating INFO_SRC
Generating INFO_BIN
Install location: C:/mysql-connector-c++-9.0.0-install
Connector libraries will be installed at: lib64

Project configuration options:

: BUILD_STATIC: OFF
Build static version of connector library

: WITH_SSL: C:\openssl-3.3.1-install
Either 'system' to use system-wide OpenSSL library, or custom OpenSSL location. (default : system)

: WITH_PROTOBUF:
Enable, disable or point to PROTOBUF installation.

: WITH_ZLIB:
Enable, disable or point to ZLIB installation.

: WITH_LZ4:
Enable, disable or point to LZ4 installation.

: WITH_ZSTD:
Enable, disable or point to ZSTD installation.

: WITH_JDBC: ON
Whether to build a variant of connector library which implements legacy JDBC API

: WITH_MYSQL: C:/Program Files/MySQL/MySQL Server 9.0
Base location of (monolithic) MySQL installation.

-- Configuring done (14.5s)
-- Generating done (0.1s)
CMake Warning:
Manually-specified variables were not used by the project:

WITH_BOOST


-- Build files have been written to: C:/mysql-connector-c++-9.0.0-build

dinus@VivoBook-X513EP MINGW64 /c/mysql-connector-c++-9.0.0-build
$ cmake --build . --config Debug
[2/121] C:\Windows\system32\cmd.exe /C "cd /D C:...tor-c++-9.0.0-src/cdk/cmake/ext/ext-build.cmake"
== Running extrnal build at: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/zlib (Debug)
[1/16] Building C object CMakeFiles/zlib.dir/compress.obj
[2/16] Building C object CMakeFiles/zlib.dir/gzlib.obj
[3/16] Building C object CMakeFiles/zlib.dir/crc32.obj
[4/16] Building C object CMakeFiles/zlib.dir/gzclose.obj
[5/16] Building C object CMakeFiles/zlib.dir/adler32.obj
[6/16] Building C object CMakeFiles/zlib.dir/gzwrite.obj
[7/16] Building C object CMakeFiles/zlib.dir/inflate.obj
[8/16] Building C object CMakeFiles/zlib.dir/infback.obj
[9/16] Building C object CMakeFiles/zlib.dir/deflate.obj
[10/16] Building C object CMakeFiles/zlib.dir/gzread.obj
[11/16] Building C object CMakeFiles/zlib.dir/inftrees.obj
[12/16] Building C object CMakeFiles/zlib.dir/uncompr.obj
[13/16] Building C object CMakeFiles/zlib.dir/inffast.obj
[14/16] Building C object CMakeFiles/zlib.dir/zutil.obj
[15/16] Building C object CMakeFiles/zlib.dir/trees.obj
[16/16] Linking C static library libzlib.a
== Extrnal build done
[6/121] C:\Windows\system32\cmd.exe /C "cd /D C:...tor-c++-9.0.0-src/cdk/cmake/ext/ext-build.cmake"
== Running extrnal build at: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/lz4 (Debug)
[1/5] Building C object CMakeFiles/lz4.dir/lib/lz4frame.c.obj
[2/5] Building C object CMakeFiles/lz4.dir/lib/xxhash.c.obj
[3/5] Building C object CMakeFiles/lz4.dir/lib/lz4hc.c.obj
[4/5] Building C object CMakeFiles/lz4.dir/lib/lz4.c.obj
[5/5] Linking C static library liblz4.a
== Extrnal build done
[9/121] Building CXX object cdk/foundation/CMakeFiles/cdk_foundation.dir/socket_detail.cc.obj
C:/mysql-connector-c++-9.0.0-src/cdk/foundation/socket_detail.cc:57: warning: ignoring '#pragma comment ' [-Wunknown-pragmas]
57 | #pragma comment(lib,"Dnsapi")
|
In file included from C:/mysql-connector-c++-9.0.0-src/cdk/include/mysql/cdk/foundation/types.h:35,
from C:/mysql-connector-c++-9.0.0-src/cdk/foundation/socket_detail.h:33,
from C:/mysql-connector-c++-9.0.0-src/cdk/foundation/socket_detail.cc:31:
C:/mysql-connector-c++-9.0.0-src/cdk/foundation/socket_detail.cc: In function 'int cdk::foundation::connection::detail::poll_one(Socket, Poll_mode, bool, uint64_t)':
C:/mysql-connector-c++-9.0.0-src/cdk/include/mysql/cdk/foundation/common.h:47:23: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
47 | #define PRAGMA_CDK(X) _Pragma(#X)
| ^~~~~~~
C:/mysql-connector-c++-9.0.0-src/cdk/include/mysql/cdk/foundation/common.h:48:32: note: in expansion of macro 'PRAGMA_CDK'
48 | #define DISABLE_WARNING_CDK(W) PRAGMA_CDK(GCC diagnostic ignored #W)
| ^~~~~~~~~~
C:/mysql-connector-c++-9.0.0-src/cdk/foundation/socket_detail.cc:852:3: note: in expansion of macro 'DISABLE_WARNING_CDK'
852 | DISABLE_WARNING_CDK(4548)
| ^~~~~~~~~~~~~~~~~~~
[11/121] Building CXX object jdbc/driver/CMakeFiles/jdbc.dir/mysql_art_resultset.cpp.obj
FAILED: jdbc/driver/CMakeFiles/jdbc.dir/mysql_art_resultset.cpp.obj
C:\mingw64\bin\c++.exe -DCONCPP_BUILD_SHARED -DHAVE_TYPE_VECTOR -DMYSQLCLIENT_STATIC_BINDING -DNOGDI -DWIN32_LEAN_AND_MEAN -Dconnector_jdbc_EXPORTS -IC:/mysql-connector-c++-9.0.0-build/jdbc/driver -IC:/mysql-connector-c++-9.0.0-src/include -IC:/mysql-connector-c++-9.0.0-src/jdbc -IC:/mysql-connector-c++-9.0.0-build/jdbc -IC:/mysql-connector-c++-9.0.0-build/jdbc/cppconn -IC:/mysql-connector-c++-9.0.0-build/jdbc/driver/nativeapi -isystem "C:/Program Files/MySQL/MySQL Server 9.0/include" -Wall -fdebug-prefix-map=C:/mysql-connector-c++-9.0.0-src=. -g -std=c++17 -fPIC -fvisibility=hidden -Wno-stringop-overflow -Wno-unused-parameter -Wno-deprecated-declarations -MD -MT jdbc/driver/CMakeFiles/jdbc.dir/mysql_art_resultset.cpp.obj -MF jdbc\driver\CMakeFiles\jdbc.dir\mysql_art_resultset.cpp.obj.d -o jdbc/driver/CMakeFiles/jdbc.dir/mysql_art_resultset.cpp.obj -c C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_resultset.cpp
In file included from C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:36,
from C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_resultset.cpp:37:
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/nativeapi/mysql_private_iface.h:81: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
81 | #pragma warning(disable:4251)
|
In file included from C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:38:
C:/mysql-connector-c++-9.0.0-src/jdbc/cppconn/sqlstring.h:46: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
46 | #pragma warning(push)
|
C:/mysql-connector-c++-9.0.0-src/jdbc/cppconn/sqlstring.h:47: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
47 | #pragma warning(disable: 4251)
|
C:/mysql-connector-c++-9.0.0-src/jdbc/cppconn/sqlstring.h:51: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
51 | #pragma warning(pop)
|
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_resultset.cpp: In member function 'uint64_t sql::mysql::MyVal::getUInt64()':
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_resultset.cpp:168:30: error: unable to find numeric literal operator 'operator""ui64'
168 | return val.bval ? UL64(1) : UL64(0);
| ^
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:45:17: note: in definition of macro 'UL64'
45 | #define UL64(x) x##ui64
| ^
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_resultset.cpp:168:30: note: use '-fext-numeric-literals' to enable more built-in suffixes
168 | return val.bval ? UL64(1) : UL64(0);
| ^
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:45:17: note: in definition of macro 'UL64'
45 | #define UL64(x) x##ui64
| ^
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_resultset.cpp:168:40: error: unable to find numeric literal operator 'operator""ui64'
168 | return val.bval ? UL64(1) : UL64(0);
| ^
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:45:17: note: in definition of macro 'UL64'
45 | #define UL64(x) x##ui64
| ^
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_resultset.cpp:168:40: note: use '-fext-numeric-literals' to enable more built-in suffixes
168 | return val.bval ? UL64(1) : UL64(0);
| ^
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:45:17: note: in definition of macro 'UL64'
45 | #define UL64(x) x##ui64
| ^
[17/121] Building CXX object jdbc/driver/CMakeFiles/jdbc.dir/mysql_art_rset_metadata.cpp.obj
In file included from C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:36,
from C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_art_rset_metadata.cpp:35:
C:/mysql-connector-c++-9.0.0-src/jdbc/driver/nativeapi/mysql_private_iface.h:81: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
81 | #pragma warning(disable:4251)
|
In file included from C:/mysql-connector-c++-9.0.0-src/jdbc/driver/mysql_util.h:38:
C:/mysql-connector-c++-9.0.0-src/jdbc/cppconn/sqlstring.h:46: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
46 | #pragma warning(push)
|
C:/mysql-connector-c++-9.0.0-src/jdbc/cppconn/sqlstring.h:47: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
47 | #pragma warning(disable: 4251)
|
C:/mysql-connector-c++-9.0.0-src/jdbc/cppconn/sqlstring.h:51: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
51 | #pragma warning(pop)
|
[18/121] C:\Windows\system32\cmd.exe /C "cd /D C...tor-c++-9.0.0-src/cdk/cmake/ext/ext-build.cmake"
== Running extrnal build at: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/zstd (Debug)
[1/30] Building C object CMakeFiles/zstd.dir/lib/common/threading.c.obj
[2/30] Building C object CMakeFiles/zstd.dir/lib/common/error_private.c.obj
[3/30] Building C object CMakeFiles/zstd.dir/lib/common/debug.c.obj
[4/30] Building C object CMakeFiles/zstd.dir/lib/common/pool.c.obj
[5/30] Building C object CMakeFiles/zstd.dir/lib/common/zstd_common.c.obj
[6/30] Building C object CMakeFiles/zstd.dir/lib/common/entropy_common.c.obj
[7/30] Building C object CMakeFiles/zstd.dir/lib/common/xxhash.c.obj
[8/30] Building C object CMakeFiles/zstd.dir/lib/compress/fse_compress.c.obj
[9/30] Building C object CMakeFiles/zstd.dir/lib/common/fse_decompress.c.obj
[10/30] Building C object CMakeFiles/zstd.dir/lib/compress/hist.c.obj
[11/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_compress_literals.c.obj
[12/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_compress_sequences.c.obj
[13/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_compress_superblock.c.obj
[14/30] Building C object CMakeFiles/zstd.dir/lib/compress/huf_compress.c.obj
[15/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_ldm.c.obj
[16/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_double_fast.c.obj
[17/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstdmt_compress.c.obj
[18/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_compress.c.obj
[19/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_fast.c.obj
[20/30] Building C object CMakeFiles/zstd.dir/lib/decompress/zstd_ddict.c.obj
[21/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_opt.c.obj
[22/30] Building C object CMakeFiles/zstd.dir/lib/dictBuilder/cover.c.obj
[23/30] Building C object CMakeFiles/zstd.dir/lib/decompress/zstd_decompress.c.obj
[24/30] Building C object CMakeFiles/zstd.dir/lib/decompress/huf_decompress.c.obj
[25/30] Building C object CMakeFiles/zstd.dir/lib/decompress/zstd_decompress_block.c.obj
[26/30] Building C object CMakeFiles/zstd.dir/lib/dictBuilder/divsufsort.c.obj
[27/30] Building C object CMakeFiles/zstd.dir/lib/dictBuilder/fastcover.c.obj
[28/30] Building C object CMakeFiles/zstd.dir/lib/dictBuilder/zdict.c.obj
[29/30] Building C object CMakeFiles/zstd.dir/lib/compress/zstd_lazy.c.obj
[30/30] Linking C static library libzstd.a
== Extrnal build done
[20/121] C:\Windows\system32\cmd.exe /C "cd /D C...tor-c++-9.0.0-src/cdk/cmake/ext/ext-build.cmake"
== Running extrnal build at: C:/mysql-connector-c++-9.0.0-build/cdk/protocol/mysqlx/protobuf (Debug)
[1/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/arena.cc.obj
[2/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/inlined_string_field.cc.obj
[3/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/implicit_weak_message.cc.obj
[4/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/arenastring.cc.obj
[5/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/any_lite.cc.obj
[6/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_enum_util.cc.obj
[7/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_message_util.cc.obj
[8/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_message_tctable_lite.cc.obj
In file included from C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_lite.cc:36:
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h: In function 'void google::protobuf::internal::AlignFail(uintptr_t) [with long long unsigned int align = 4]':
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h:103:1: warning: 'noreturn' function does return
103 | }
| ^
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h: In function 'void google::protobuf::internal::AlignFail(uintptr_t) [with long long unsigned int align = 8]':
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h:103:1: warning: 'noreturn' function does return
[9/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_message_table_driven_lite.cc.obj
[10/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/strtod.cc.obj
[11/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/zero_copy_stream_impl_lite.cc.obj
[12/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/zero_copy_stream.cc.obj
[13/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/coded_stream.cc.obj
[14/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/zero_copy_stream_impl.cc.obj
[15/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/map.cc.obj
[16/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/extension_set.cc.obj
[17/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/parse_context.cc.obj
[18/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/io_win32.cc.obj
[19/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/message_lite.cc.obj
[20/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/bytestream.cc.obj
[21/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/int128.cc.obj
[22/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/status.cc.obj
[23/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/statusor.cc.obj
[24/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/repeated_field.cc.obj
[25/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/common.cc.obj
[26/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/repeated_ptr_field.cc.obj
[27/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/stringpiece.cc.obj
[28/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/stringprintf.cc.obj
[29/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/time.cc.obj
[30/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/wire_format_lite.cc.obj
[31/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/any.cc.obj
[32/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/strutil.cc.obj
[33/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/any.pb.cc.obj
[34/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/api.pb.cc.obj
[35/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/compiler/importer.cc.obj
[36/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/structurally_valid.cc.obj
[37/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/duration.pb.cc.obj
[38/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/empty.pb.cc.obj
[39/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/compiler/parser.cc.obj
[40/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/dynamic_message.cc.obj
[41/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_message_bases.cc.obj
[42/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/extension_set_heavy.cc.obj
[43/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/field_mask.pb.cc.obj
[44/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/gzip_stream.cc.obj
[45/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/descriptor_database.cc.obj
[46/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/descriptor.pb.cc.obj
[47/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/tokenizer.cc.obj
[48/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_message_tctable_full.cc.obj
[49/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_message_table_driven.cc.obj
[50/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/io/printer.cc.obj
[51/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/service.cc.obj
[52/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/generated_message_reflection.cc.obj
[53/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/stubs/substitute.cc.obj
[54/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/map_field.cc.obj
[55/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/message.cc.obj
[56/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/source_context.pb.cc.obj
[57/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/reflection_ops.cc.obj
[58/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/timestamp.pb.cc.obj
[59/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/delimited_message_util.cc.obj
[60/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/unknown_field_set.cc.obj
[61/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/struct.pb.cc.obj
[62/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/type.pb.cc.obj
[63/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/descriptor.cc.obj
[64/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/field_comparator.cc.obj
[65/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/field_mask_util.cc.obj
[66/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/json_escaping.cc.obj
[67/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/error_listener.cc.obj
[68/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/text_format.cc.obj
[69/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/datapiece.cc.obj
[70/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/field_mask_utility.cc.obj
[71/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/object_writer.cc.obj
[72/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/json_stream_parser.cc.obj
[73/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/json_objectwriter.cc.obj
[74/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/default_value_objectwriter.cc.obj
[75/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/protostream_objectsource.cc.obj
[76/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/type_info.cc.obj
[77/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/utility.cc.obj
[78/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/proto_writer.cc.obj
[79/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/internal/protostream_objectwriter.cc.obj
[80/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/json_util.cc.obj
[81/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/time_util.cc.obj
[82/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/type_resolver_util.cc.obj
[83/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/code_generator.cc.obj
[84/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/wire_format.cc.obj
[85/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/wrappers.pb.cc.obj
[86/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf.dir/__/src/google/protobuf/util/message_differencer.cc.obj
[87/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_enum.cc.obj
[88/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_enum_field.cc.obj
[89/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_field.cc.obj
[90/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_extension.cc.obj
[91/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_generator.cc.obj
[92/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_map_field.cc.obj
[93/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_file.cc.obj
[94/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/command_line_interface.cc.obj
[95/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.cc.obj
[96/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_parse_function_generator.cc.obj
[97/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_message_field.cc.obj
[98/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_helpers.cc.obj
[99/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc.obj
[100/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_doc_comment.cc.obj
[101/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_service.cc.obj
[102/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_enum.cc.obj
[103/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_string_field.cc.obj
[104/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_enum_field.cc.obj
[105/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/cpp/cpp_message.cc.obj
[106/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_field_base.cc.obj
[107/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_generator.cc.obj
[108/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_helpers.cc.obj
[109/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_map_field.cc.obj
[110/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_message_field.cc.obj
[111/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_message.cc.obj
[112/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc.obj
[113/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc.obj
[114/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc.obj
[115/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc.obj
[116/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_source_generator_base.cc.obj
[117/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_repeated_message_field.cc.obj
[118/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/csharp/csharp_wrapper_field.cc.obj
[119/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_doc_comment.cc.obj
[120/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_context.cc.obj
[121/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_enum.cc.obj
[122/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_enum_field.cc.obj
[123/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_enum_lite.cc.obj
[124/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_enum_field_lite.cc.obj
[125/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_extension.cc.obj
[126/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_extension_lite.cc.obj
[127/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_field.cc.obj
[128/205] Linking CXX static library protobuf-3.19.6\cmake\libprotobufd.a
[129/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_generator_factory.cc.obj
[130/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_generator.cc.obj
[131/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_file.cc.obj
[132/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_map_field.cc.obj
[133/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_helpers.cc.obj
[134/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_kotlin_generator.cc.obj
[135/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_map_field_lite.cc.obj
[136/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message.cc.obj
[137/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_builder.cc.obj
[138/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_field.cc.obj
[139/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_builder_lite.cc.obj
[140/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_field_lite.cc.obj
[141/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_name_resolver.cc.obj
[142/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/js/well_known_types_embed.cc.obj
[143/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_message_lite.cc.obj
[144/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_primitive_field_lite.cc.obj
[145/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_service.cc.obj
[146/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_primitive_field.cc.obj
[147/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_shared_code_generator.cc.obj
[148/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_string_field.cc.obj
[149/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/java/java_string_field_lite.cc.obj
[150/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_enum.cc.obj
[151/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_extension.cc.obj
[152/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc.obj
[153/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_field.cc.obj
[154/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_generator.cc.obj
[155/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc.obj
[156/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_file.cc.obj
[157/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/js/js_generator.cc.obj
[158/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc.obj
[159/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc.obj
[160/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc.obj
[161/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc.obj
[162/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/plugin.cc.obj
[163/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/objectivec/objectivec_message.cc.obj
[164/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/zip_writer.cc.obj
[165/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/arena.cc.obj
[166/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/plugin.pb.cc.obj
[167/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/any_lite.cc.obj
[168/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/subprocess.cc.obj
[169/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/php/php_generator.cc.obj
[170/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/python/python_generator.cc.obj
[171/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotoc.dir/__/src/google/protobuf/compiler/ruby/ruby_generator.cc.obj
[172/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/generated_enum_util.cc.obj
[173/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/arenastring.cc.obj
[174/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/io/strtod.cc.obj
[175/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/generated_message_table_driven_lite.cc.obj
[176/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/extension_set.cc.obj
[177/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/generated_message_tctable_lite.cc.obj
In file included from C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_lite.cc:36:
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h: In function 'void google::protobuf::internal::AlignFail(uintptr_t) [with long long unsigned int align = 4]':
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h:103:1: warning: 'noreturn' function does return
103 | }
| ^
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h: In function 'void google::protobuf::internal::AlignFail(uintptr_t) [with long long unsigned int align = 8]':
C:/mysql-connector-c++-9.0.0-src/cdk/extra/protobuf/protobuf-3.19.6/src/google/protobuf/generated_message_tctable_impl.h:103:1: warning: 'noreturn' function does return
[178/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/io/coded_stream.cc.obj
[179/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/implicit_weak_message.cc.obj
[180/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/inlined_string_field.cc.obj
[181/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/generated_message_util.cc.obj
[182/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/io/zero_copy_stream.cc.obj
[183/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/io/io_win32.cc.obj
[184/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/io/zero_copy_stream_impl.cc.obj
[185/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/io/zero_copy_stream_impl_lite.cc.obj
[186/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/map.cc.obj
[187/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/bytestream.cc.obj
[188/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/repeated_ptr_field.cc.obj
[189/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/statusor.cc.obj
[190/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/parse_context.cc.obj
[191/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/status.cc.obj
[192/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/message_lite.cc.obj
[193/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/int128.cc.obj
[194/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/stringpiece.cc.obj
[195/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/stringprintf.cc.obj
[196/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/repeated_field.cc.obj
[197/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/common.cc.obj
[198/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/structurally_valid.cc.obj
[199/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/time.cc.obj
[200/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/stubs/strutil.cc.obj
[201/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/protoc.dir/__/src/google/protobuf/compiler/main.cc.obj
[202/205] Building CXX object protobuf-3.19.6/cmake/CMakeFiles/libprotobuf-lite.dir/__/src/google/protobuf/wire_format_lite.cc.obj
[203/205] Linking CXX static library protobuf-3.19.6\cmake\libprotobuf-lited.a
[204/205] Linking CXX static library protobuf-3.19.6\cmake\libprotocd.a
[205/205] Linking CXX executable runtime_output_directory\protoc.exe
== Extrnal build done
ninja: build stopped: subcommand failed.

Anyone know the solution to this?

use Mingw to complie have -Werror (3 replies)

$
0
0
from C:\Users\ASUS\Desktop\mingw\mysql-connector-cpp\cdk\extra\protobuf\protobuf-

use Mingw to complie cant find file or directory (1 reply)

$
0
0
$ cmake --build . --config Debug

[ 96%] Linking CXX shared library libmysqlcppconn-10.dll
Merging SHARED library: C:\Users\ASUS\Desktop\mingw\jdbc\libmysqlcppconn-10.dll
Merge options:
- using gcc tools
F:\CLion 2023.3.4\bin\mingw\bin/ld.exe: cannot find Files/MySQL/MySQL: No such file or directory
F:\CLion 2023.3.4\bin\mingw\bin/ld.exe: cannot find Server: No such file or directory
F:\CLion 2023.3.4\bin\mingw\bin/ld.exe: cannot find 8.0/lib: No such file or directory
F:\CLion 2023.3.4\bin\mingw\bin/ld.exe: cannot find Files/MySQL/MySQL: No such file or directory
F:\CLion 2023.3.4\bin\mingw\bin/ld.exe: cannot find Server: No such file or directory
F:\CLion 2023.3.4\bin\mingw\bin/ld.exe: cannot find 8.0/lib/private: No such file or directory
collect2.exe: error: ld returned 1 exit status
CMake Error at C:/Users/ASUS/Desktop/mingw/libutils/merge_archives.cmake:260 (message):
Failed to link shared library libmysqlcppconn-10
Call Stack (most recent call first):
C:/Users/ASUS/Desktop/mingw/libutils/merge_archives.cmake:201 (merge_libraries_gcc)
C:/Users/ASUS/Desktop/mingw/libutils/merge_archives.cmake:799 (main)

I'm using c++ with prepared db (no replies)

$
0
0
#include <iostream> #include <windows.h> #include <sql.h> #include <sqlext.h> #include <string> #include <cstring> #include"stdafx.h" // Constants #define MAX_NAME_SIZE 256 #define OSUCCESS 0 #define OFAILURE -1 // Global variables SQLHENV m_SqlEnv = NULL; // ODBC environment handle SQLHDBC m_SqlConn = NULL; // ODBC connection handle SQLHSTMT m_SqlStmt = NULL; // ODBC statement handle bool m_bIsOpen = false; // Connection status flag // Function prototypes void get_Error(SQLSMALLINT handleType, SQLHANDLE handle); bool DFT_ODBC_Initialize(); void Cleanup(); int _tmain(int argc, _TCHAR* argv[]) {   // Static initialization flag   static int iIsInitialized = 0;   // Connection string construction   char connstr[500] = "DSN=";   const char* p_cpDSNName = "mysql_dsn";   const char* p_cpUserName = "root";   const char* p_cpPassword = "dedupe";      SQLHANDLE m_SqlStmt;   SQLHANDLE m_SqlConn;   //  static int iIsInitialized = 0;   char        m_cUserName[MAX_NAME_SIZE]; // create member char array varaible   char        m_cPassword[MAX_NAME_SIZE]; // create member char array varaible   char        m_cDSNName[MAX_NAME_SIZE];// create member char array varaible   strcat(connstr, p_cpDSNName);   /*strcat(connstr,";Database=");   strcat(connstr,p_cpDBName);*/   strcat(connstr, ";UID=");   strcat(connstr, p_cpUserName);   strcat(connstr, ";PWD=");   strcat(connstr, p_cpPassword);   strcat(connstr, ";MARS_Connection=Yes");   if (iIsInitialized == 0) // This is to ensure that , it will be called once in the lifetime of the program.   {     if (!DFT_ODBC_Initialize())     {       MessageBox(NULL, "FAILED", "Initialization of ODBC failed.", MB_OK);       return OFAILURE;     }     else       iIsInitialized = 1;   }   //m_bIsOpen = false; // set m_bIsOpen to false   try   {     memset(m_cUserName, 0, MAX_NAME_SIZE); // set memory of size m_cUserName     memset(m_cPassword, 0, MAX_NAME_SIZE);// set memory of size m_cPassword     memset(m_cDSNName, 0, MAX_NAME_SIZE);// set memory of size m_cServiceName     strcpy(m_cUserName, p_cpUserName);//string copy p_cpUserName to m_cUserName     strcpy(m_cPassword, p_cpPassword);//string copy p_cpPassword to m_cPassword     strcpy(m_cDSNName, p_cpDSNName);//string copy p_cpServiceName to m_cServiceName     if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_DBC, m_SqlEnv, &m_SqlConn)))     {       get_Error(SQL_HANDLE_ENV, m_SqlEnv);     }     SQLCHAR retconn[1024];     //if(!SQL_SUCCEEDED(SQLConnect (m_SqlConn ,(SQLCHAR *) m_cDSNName, SQL_NTS, (SQLCHAR *)m_cUserName, SQL_NTS,(SQLCHAR *) m_cPassword, SQL_NTS)))     if (!SQL_SUCCEEDED(SQLDriverConnect(m_SqlConn, NULL, (SQLCHAR*)connstr, SQL_NTS, retconn, 1024, NULL, SQL_DRIVER_NOPROMPT)))     {       get_Error(SQL_HANDLE_DBC, m_SqlConn);     }     //MessageBox(NULL,(char*)retconn,"connstr",MB_OK);     if (!SQL_SUCCEEDED(SQLAllocHandle(SQL_HANDLE_STMT, m_SqlConn, &m_SqlStmt)))     {       get_Error(SQL_HANDLE_STMT, m_SqlStmt);     }     if (!SQL_SUCCEEDED(SQLSetStmtAttr(m_SqlStmt, SQL_ATTR_QUERY_TIMEOUT, (SQLPOINTER)3600, SQL_IS_INTEGER)))     {       get_Error(SQL_HANDLE_STMT, m_SqlStmt);     }     if (!SQL_SUCCEEDED(SQLSetConnectAttr(m_SqlConn, SQL_ATTR_CONNECTION_TIMEOUT, (SQLPOINTER)3600, 0)))     {       get_Error(SQL_HANDLE_DBC, m_SqlConn);     }     if (!SQL_SUCCEEDED(SQLSetConnectAttr(m_SqlConn, SQL_ATTR_AUTOCOMMIT, (SQLPOINTER)SQL_AUTOCOMMIT_ON, 0)))     {       get_Error(SQL_HANDLE_DBC, m_SqlConn);     }     else     {       // Prepare SQL statement with parameter placeholder       const char* query = "SELECT * FROM base WHERE uuid = ?";       if (!SQL_SUCCEEDED(SQLPrepare(m_SqlStmt, (SQLCHAR*)query, SQL_NTS))) {         get_Error(SQL_HANDLE_STMT, m_SqlStmt);         return OFAILURE;       }       // Create a buffer to hold the UUID value for binding       SQLCHAR uuidParam[37]; // 36 characters for UUID + null terminator       // Bind the parameter once       if (!SQL_SUCCEEDED(SQLBindParameter(m_SqlStmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, 37, 0, &uuidParam, 0, NULL))) {         get_Error(SQL_HANDLE_STMT, m_SqlStmt);         return OFAILURE;       }       // Generate and use 1000 UUIDs (For demonstration, using uuid-1, uuid-2, ..., uuid-1000)       for (int i = 1; i <= 10000; ++i) {         // Create a simple UUID string: "uuid-1", "uuid-2", ..., "uuid-1000"         snprintf((char*)uuidParam, sizeof(uuidParam), "%d", i);         // Execute the prepared statement         if (!SQL_SUCCEEDED(SQLExecute(m_SqlStmt))) {           get_Error(SQL_HANDLE_STMT, m_SqlStmt);           continue; // Skip to the next UUID if execution fails         }         // Fetch and display the results for the current UUID         SQLINTEGER id;         SQLCHAR column_name[100];         SQLCHAR column_value[100];         // Iterate over the rows for the current UUID         while (SQL_SUCCEEDED(SQLFetch(m_SqlStmt))) {           // Example of fetching columns (change based on your table schema)           SQLGetData(m_SqlStmt, 1, SQL_C_SLONG, &id, 0, NULL); // Assuming 1st column is an integer (ID)           SQLGetData(m_SqlStmt, 2, SQL_C_CHAR, column_name, sizeof(column_name), NULL); // 2nd column: name           SQLGetData(m_SqlStmt, 3, SQL_C_CHAR, column_value, sizeof(column_value), NULL); // 3rd column: value           // Print the result for this row           std::cout << "UUID: uuid-" << i << ", ID: " << id << ", Name: " << column_name << ", Value: " << column_value << std::endl;         }         // Reset the statement for the next UUID (optional)         SQLFreeStmt(m_SqlStmt, SQL_CLOSE); // Close the result set to reuse the statement handle for the next UUID       }       // Cleanup       SQLFreeHandle(SQL_HANDLE_STMT, m_SqlStmt);       SQLFreeHandle(SQL_HANDLE_DBC, m_SqlConn);       return OSUCCESS;     }   }   catch (...)   {     return OFAILURE;   }   return true;//m_bIsOpen; // return the m_bIsOpen value } // Error handling function to retrieve and display ODBC error details void get_Error(SQLSMALLINT handleType, SQLHANDLE handle) {   SQLCHAR SQLState[6], message[256];   SQLINTEGER nativeError;   SQLSMALLINT msgLen;   // Retrieve error message   SQLGetDiagRec(handleType, handle, 1, SQLState, &nativeError, message, sizeof(message), &msgLen);   // Display error message   std::cerr << "ODBC Error: " << message << " (SQLState: " << SQLState << ", NativeError: " << nativeError << ")" << std::endl; } // Initialize the ODBC environment bool DFT_ODBC_Initialize() {   if (SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &m_SqlEnv) != SQL_SUCCESS) {     std::cerr << "Unable to allocate ODBC environment handle." << std::endl;     return false;   }   // Set the ODBC version to 3.x   if (SQLSetEnvAttr(m_SqlEnv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, 0) != SQL_SUCCESS) {     std::cerr << "Unable to set ODBC version." << std::endl;     SQLFreeHandle(SQL_HANDLE_ENV, m_SqlEnv);     return false;   }   return true; }



In this above code at line Reset the statment for next uuid option .. it's not able free the memory.. at every iteration memory is increasing, can help with this , for this memory issue
Viewing all 527 articles
Browse latest View live


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