MySQL plugin for San Andreas Multiplayer. Contribute to pBlueG/SA-MP-MySQL development by creating an account on GitHub.
Foni dlya shapok na yutub en. #include To build such code with Connector/C++ 8 without modifying it, add $MYSQL_CPPCONN_DIR/include/jdbc to the include path. The X DevAPI uses C++11 language features. For that reason enable C++11 support in the compiler using the -std=c++11 option when building code that uses X DevAPI. This is not needed for X DevAPI for C (which is a plain C API) nor for the legacy JDBC API which is based on plain C++. Note The legacy API requires Boost headers.
The location of these headers needs to be added to the include path to correctly compile legacy code. Only the headers from Boost are needed – the Boost libraries are not used during linking phase. Using the shared library Depending on the platform, the shared Connector/C++ library is named: • libmysqlcppconn8.so on Unix platforms (soname libmysqlcppconn8.so.1) • libmysqlcppconn8.dylib on the OSX platform (link name libmysqlcppconn8.1.dylib) • mysqlcppconn8-1-vsXX.dll on Windows platforms (with import library vsXX/mysqlcppconn8.lib, see for more details) This library implements the new X DevAPI and X DevAPI for C.
Connector/C++ 8.0 also includes the legacy connector library libmsysqlcppconn(.so/.dylib/.dll) which implements the legacy JDBC4 API. To build code that uses new APIs, add -lmysqlcppconn8 to the linker options (add -lmysqlcppconn when building legacy code). This requires that $MYSQL_CONCPP_DIR/lib or $MYSQL_CONCPP_DIR/lib64 (the latter on a 64-bit platform) is added to the linker path ( -L $MYSQL_CPPCONN_DIR/lib64 linker option). Due to ABI incompatiblities between different compiler versions, the code that uses Connector/C++ libraries should be built with the same compiler version as the connector itself.
The information about compiler version used to build connector libraries can be found inside INFO_BIN file distributed with the connector. In principle a different version of the compiler can be used provided that it is ABI compatible, but it is difficult to determine which versions of the compiler are ABI compatible with each other. An example Makefile to build an application which uses Connector/C++ X DevAPI, with sources in app.cc is shown below.
Cc -I./include -L./lib64 app.c -lmysqlcppconn8 -o app Note that the resulting code, even though it is compiled as plain C, will depend on the C++ runtime ( libstdc++). Note When running an application which uses the shared Connector/C++ library, the library and its runtime dependencies must be found by the dynamic linker.
The dynamic linker must be properly configured to find Connector/C++ libraries and their dependencies. Connector/C++ libraries built by MySQL depend on OpenSSL libraries. The latter must be installed on the system in order to run code that links against Connector/C++ libraries. Another option is to put OpenSSL libraries in the same location as Connector/C++. In this case the dynamic linker should find them next to the connector library. It is possible to build Connector/C++ libraries without OpenSSL, using internal implementation of TLS connections.
In this case the OpenSSL libraries are not required at runtime. Using the static library It is possible to link your application with the static connector library. This way there is no runtime dependency on the connector and the resulting binary can run on systems where Connector/C++ is not installed. Note However, even when linking statically, the resulting code still depends on OpenSSL libraries and all other runtime dependencies of the Connector/C++ library.
- Author: admin
- Category: Category