[CONCPP-59] Unable to use Connector/C++ on Windows Created: 2021-01-26 Updated: 2021-02-04 Resolved: 2021-02-04 |
|
| Status: | Closed |
| Project: | MariaDB Connector/C++ |
| Component/s: | General |
| Affects Version/s: | 0.9.4 |
| Fix Version/s: | 1.0.0 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Rob Hedgpeth (Inactive) | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 64-bit |
||
| Description |
|
Using the documentation instructions here -> https://mariadb.com/docs/appdev/connector-cpp/ I attempted to install, configure, and compile a sample C++ application (on Windows 64-bit) that uses Connector/C. After installing the latest Windows 64-bit version from https://mariadb.com/downloads/#connectors, I attempted to compile a sample application using:
To which I received the following: PS C:\Users\Rob\Development\dev-example-todo\console\cpp> g++ -o test test.cpp -lmariadbcpp After receiving advice from Larwin I removed the "mariadbcpp" library directory from the include, and instead executed a command to include the header files directly:
To which I received an error: PS C:\Users\Rob\Development\dev-example-todo\console\cpp> g++ -o test test.cpp -std=c+11 -I"C:\Program Files\MariaDB\MariaDB C+ Connector 64-bit\include" I then git cloned the source from https://github.com/mariadb-corporation/mariadb-connector-cpp and built an MSI. Then I manually copied over the buildconf.h file into the installed MariaDB Connector/C folder (in Program Files). After some back and forth testing I discovered I needed to add a few more headers. The missing header files:
However, after copying over the missing headers I still encountered the following error, and am unsure how to resolve: C:\Users\Rob\Development\dev-example-todo\console\cpp>g++ -o test test.cpp -std=c+11 -I"C:\Program Files\MariaDB\MariaDB C+ Connector 64-bit\include" ^~~~~~~~~~~ C:\Program Files\MariaDB\MariaDB C++ Connector 64-bit\include/Exception.h:48:32: error: function 'const char* sql::SQLException::getSQLStateCStr()' definition is marked dllimport MARIADB_EXPORTED const char* getSQLStateCStr() { return SqlState.c_str(); } ^~~~~~~~~~~~~~~ Please reach out to me if you need any more details. |
| Comments |
| Comment by Lawrin Novitsky [ 2021-02-04 ] |
|
Commit ffb3ba5 |
| Comment by Rob Hedgpeth (Inactive) [ 2021-02-04 ] |
|
You rock! |