Конфликт обьявлений mySQL connector + C++

346
10 августа 2021, 04:20

Пытаюсь использовать коннектер MySQL и C++ среда : Windows 10 Code::Blocks 17.12 MySQL 8.0 MySQL Connector C++ 8.0

Понял, что идет переобьявление чего-то. При попытке "прокомментировать" код из коннектора, который и переобьявляет эти "инты" IDE не реагирует, а при попытке сохранения изменений, выскакивает ошибка(аж два раза), что такойто такойто файл, вы сохранить(==изменить?) не можете.

mingw32-g++.exe -Wall -std=c++14 -O2 -I"C:\Program Files\MySQL\MySQL Connector C++ 8.0\include" -I"C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc" -I"C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\mysql" -I"C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\mysqlx" -I"C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc\cppconn" -c C:\c++\programs\SQLfinal_connect\main.cpp -o obj\Release\main.o mingw32-g++.exe -L"C:\Program Files\MySQL\MySQL Connector C++ 8.0\lib64" -L"C:\Program Files\MySQL\MySQL Connector C++ 8.0\lib64\vs14" -o bin\Release\SQLfinal_connect.exe obj\Release\main.o -lmysqlpp -lmysqlclient mysqlpp mysqlclient nsl z m -s
In file included from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/warning.h:40:0, from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/connection.h:39, from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:36, from C:\c++\programs\SQLfinal_connect\main.cpp:4: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/sqlstring.h:46:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(push) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/sqlstring.h:47:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(disable: 4251) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/sqlstring.h:51:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(pop) ^ In file included from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/connection.h:39:0, from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:36, from C:\c++\programs\SQLfinal_connect\main.cpp:4: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/warning.h:46:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning (disable : 4290) ^ In file included from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/variant.h:44:0, from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/connection.h:41, from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:36, from C:\c++\programs\SQLfinal_connect\main.cpp:4: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/exception.h:65:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning (disable : 4290) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/exception.h:69:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(push) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/exception.h:70:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(disable: 4275) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/exception.h:75:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(pop) ^ In file included from C:\c++\programs\SQLfinal_connect\main.cpp:4:0: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:183:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(push) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:184:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(disable: 4251) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:188:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(pop) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:194:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(push) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:195:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(disable: 4251) ^ C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/mysql_connection.h:201:0: warning: ignoring #pragma warning [-Wunknown-pragmas] #pragma warning(pop) ^ In file included from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/resultset.h:36:0, from C:\c++\programs\SQLfinal_connect\main.cpp:8: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/config.h:101:19: error: conflicting declaration 'typedef long int int32_t' typedef __int32 int32_t; ^ In file included from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/stdint.h:9:0, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/cstdint:41, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/bits/char_traits.h:380, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ios:40, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ostream:38, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/iostream:39, from C:\c++\programs\SQLfinal_connect\main.cpp:3: C:/c++/codeblocks/MinGW/include/stdint.h:31:14: note: previous declaration as 'typedef int int32_t' typedef int int32_t; ^ In file included from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/resultset.h:36:0, from C:\c++\programs\SQLfinal_connect\main.cpp:8: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/config.h:105:26: error: conflicting declaration 'typedef long unsigned int uint32_t' typedef unsigned __int32 uint32_t; ^ In file included from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/stdint.h:9:0, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/cstdint:41, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/bits/char_traits.h:380, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ios:40, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ostream:38, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/iostream:39, from C:\c++\programs\SQLfinal_connect\main.cpp:3: C:/c++/codeblocks/MinGW/include/stdint.h:32:20: note: previous declaration as 'typedef unsigned int uint32_t' typedef unsigned uint32_t; ^ In file included from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/statement.h:36:0, from C:\c++\programs\SQLfinal_connect\main.cpp:9: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/config.h:101:19: error: conflicting declaration 'typedef long int int32_t' typedef __int32 int32_t; ^ In file included from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/stdint.h:9:0, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/cstdint:41, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/bits/char_traits.h:380, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ios:40, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ostream:38, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/iostream:39, from C:\c++\programs\SQLfinal_connect\main.cpp:3: C:/c++/codeblocks/MinGW/include/stdint.h:31:14: note: previous declaration as 'typedef int int32_t' typedef int int32_t; ^ In file included from C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/statement.h:36:0, from C:\c++\programs\SQLfinal_connect\main.cpp:9: C:\Program Files\MySQL\MySQL Connector C++ 8.0\include\jdbc/cppconn/config.h:105:26: error: conflicting declaration 'typedef long unsigned int uint32_t' typedef unsigned __int32 uint32_t; ^ In file included from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/stdint.h:9:0, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/cstdint:41, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/bits/char_traits.h:380, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ios:40, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/ostream:38, from C:/c++/codeblocks/MinGW/lib/gcc/mingw32/5.1.0/include/c++/iostream:39, from C:\c++\programs\SQLfinal_connect\main.cpp:3: C:/c++/codeblocks/MinGW/include/stdint.h:32:20: note: previous declaration as 'typedef unsigned int uint32_t' typedef unsigned uint32_t; ^ C:\c++\programs\SQLfinal_connect\main.cpp: In function 'int main()': C:\c++\programs\SQLfinal_connect\main.cpp:25:19: warning: unused variable 'stmt' [-Wunused-variable] sql::Statement *stmt; ^ C:\c++\programs\SQLfinal_connect\main.cpp:26:19: warning: unused variable 'res' [-Wunused-variable] sql::ResultSet *res; ^ C:\c++\programs\SQLfinal_connect\main.cpp:34:1: error: expected 'catch' before 'cout' cout << endl; ^ C:\c++\programs\SQLfinal_connect\main.cpp:34:1: error: expected '(' before 'cout' C:\c++\programs\SQLfinal_connect\main.cpp:34:1: error: 'cout' does not name a type C:\c++\programs\SQLfinal_connect\main.cpp:34:6: error: expected ')' before '<<' token cout << endl; ^ C:\c++\programs\SQLfinal_connect\main.cpp:34:6: error: expected '{' before '<<' token C:\c++\programs\SQLfinal_connect\main.cpp:34:6: error: expected primary-expression before '<<' token

Answer 1

Чтож, прошел день усердного гугления, и он дал свои результаты, спешу поделиться как решить эту проблему.

Необходимо указать macro definition

HAVE_INT8_T=1
HAVE_STDINT=1
CPPCONN_DONT_TYPEDEF_MS_TYPES_TO_C99_TYPES=1
READ ALSO
Как отключить родной datepicker в firefox?

Как отключить родной datepicker в firefox?

Использую datepicker от JqueryВ браузере firefox При нажатии на <input type="date"> отражается сразу два datepicker:

132
Как отправить на печать страницу?

Как отправить на печать страницу?

Использовал для печати страницы windowprint(), но она печатает ту страницу на которой находится данный код (например a

228