MySQL get_driver_instance not found with Connector c++ 8.0
up vote
1
down vote
favorite
I made the mistake of upgrading to MySQL Connector C++ 8.0 and Visual Studio 2017.
I have followed the examples and I'm getting the error:
error LNK2019: unresolved external symbol "class sql::mysql::MySQL_Driver * __cdecl sql::mysql::get_driver_instance(void)" (?get_driver_instance@mysql@sql@@YAPAVMySQL_Driver@12@XZ)
Here's the code:
#include "gtest/gtest.h"
#include <sstream>
#include "mysql_connection.h"
#include <jdbc/mysql_connection.h>
#include <jdbc/mysql_driver.h>
// For resultset and statements:
//#include <jdbc/cppconn/resultset.h>
//#include <jdbc/cppconn/statement.h>
TEST(MySQL, Connection)
sql::Driver * driver = sql::mysql::get_driver_instance();
ASSERT_NE(driver, nullptr);
This is a function in Google test.
I have rebuilt the Connector C++ in folder C:mysql_connector_build
.
The Debug directory contains these files:
mysqlcppconn8.exp
mysqlcppconn8.lib
mysqlcppconn8-1-vs14.dll
mysqlcppconn8-1-vs14.ilk
mysqlcppconn8-1-vs14.pdb
try.exe
try.ilk
try.pdb
I have added the path "C:mysql_connector_buildDebug"
to the Linker->General->Additional Library Directories
.
I have added mysqlcppconn8.lib
to the Linker->Input->Additional Dependencies
.
I added "CPPCONN_PUBLIC_FUNC=" to the C++->Preprocessor->Preprocessor Definitions
.
Searching the internet for the error shows resolutions for earlier versions of MySQL Connector C++ 8.0.
The code is adapted from the examples at Connector/C++ 8.0 legacy C++ API based on JDBC4
I build the Connector C++ 8.0
library according to Using Connector/C++ 8.0.
Note: searching the internet came up with the result that there isn't a compatible binary library for Visual Studio 2017 on Windows 10. The GA version of the connector library is for Visual Studio 2015.
The question is: How do I resolve the external symbol error?
Please don't refer me to What is an undefined reference/unresolved external symbol error and how do I fix it? as my issue is more at where this symbol is defined (in which library) and not how to link a library.
c++ mysql visual-studio-2017 windows-10 mysql-connector
add a comment |
up vote
1
down vote
favorite
I made the mistake of upgrading to MySQL Connector C++ 8.0 and Visual Studio 2017.
I have followed the examples and I'm getting the error:
error LNK2019: unresolved external symbol "class sql::mysql::MySQL_Driver * __cdecl sql::mysql::get_driver_instance(void)" (?get_driver_instance@mysql@sql@@YAPAVMySQL_Driver@12@XZ)
Here's the code:
#include "gtest/gtest.h"
#include <sstream>
#include "mysql_connection.h"
#include <jdbc/mysql_connection.h>
#include <jdbc/mysql_driver.h>
// For resultset and statements:
//#include <jdbc/cppconn/resultset.h>
//#include <jdbc/cppconn/statement.h>
TEST(MySQL, Connection)
sql::Driver * driver = sql::mysql::get_driver_instance();
ASSERT_NE(driver, nullptr);
This is a function in Google test.
I have rebuilt the Connector C++ in folder C:mysql_connector_build
.
The Debug directory contains these files:
mysqlcppconn8.exp
mysqlcppconn8.lib
mysqlcppconn8-1-vs14.dll
mysqlcppconn8-1-vs14.ilk
mysqlcppconn8-1-vs14.pdb
try.exe
try.ilk
try.pdb
I have added the path "C:mysql_connector_buildDebug"
to the Linker->General->Additional Library Directories
.
I have added mysqlcppconn8.lib
to the Linker->Input->Additional Dependencies
.
I added "CPPCONN_PUBLIC_FUNC=" to the C++->Preprocessor->Preprocessor Definitions
.
Searching the internet for the error shows resolutions for earlier versions of MySQL Connector C++ 8.0.
The code is adapted from the examples at Connector/C++ 8.0 legacy C++ API based on JDBC4
I build the Connector C++ 8.0
library according to Using Connector/C++ 8.0.
Note: searching the internet came up with the result that there isn't a compatible binary library for Visual Studio 2017 on Windows 10. The GA version of the connector library is for Visual Studio 2015.
The question is: How do I resolve the external symbol error?
Please don't refer me to What is an undefined reference/unresolved external symbol error and how do I fix it? as my issue is more at where this symbol is defined (in which library) and not how to link a library.
c++ mysql visual-studio-2017 windows-10 mysql-connector
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I made the mistake of upgrading to MySQL Connector C++ 8.0 and Visual Studio 2017.
I have followed the examples and I'm getting the error:
error LNK2019: unresolved external symbol "class sql::mysql::MySQL_Driver * __cdecl sql::mysql::get_driver_instance(void)" (?get_driver_instance@mysql@sql@@YAPAVMySQL_Driver@12@XZ)
Here's the code:
#include "gtest/gtest.h"
#include <sstream>
#include "mysql_connection.h"
#include <jdbc/mysql_connection.h>
#include <jdbc/mysql_driver.h>
// For resultset and statements:
//#include <jdbc/cppconn/resultset.h>
//#include <jdbc/cppconn/statement.h>
TEST(MySQL, Connection)
sql::Driver * driver = sql::mysql::get_driver_instance();
ASSERT_NE(driver, nullptr);
This is a function in Google test.
I have rebuilt the Connector C++ in folder C:mysql_connector_build
.
The Debug directory contains these files:
mysqlcppconn8.exp
mysqlcppconn8.lib
mysqlcppconn8-1-vs14.dll
mysqlcppconn8-1-vs14.ilk
mysqlcppconn8-1-vs14.pdb
try.exe
try.ilk
try.pdb
I have added the path "C:mysql_connector_buildDebug"
to the Linker->General->Additional Library Directories
.
I have added mysqlcppconn8.lib
to the Linker->Input->Additional Dependencies
.
I added "CPPCONN_PUBLIC_FUNC=" to the C++->Preprocessor->Preprocessor Definitions
.
Searching the internet for the error shows resolutions for earlier versions of MySQL Connector C++ 8.0.
The code is adapted from the examples at Connector/C++ 8.0 legacy C++ API based on JDBC4
I build the Connector C++ 8.0
library according to Using Connector/C++ 8.0.
Note: searching the internet came up with the result that there isn't a compatible binary library for Visual Studio 2017 on Windows 10. The GA version of the connector library is for Visual Studio 2015.
The question is: How do I resolve the external symbol error?
Please don't refer me to What is an undefined reference/unresolved external symbol error and how do I fix it? as my issue is more at where this symbol is defined (in which library) and not how to link a library.
c++ mysql visual-studio-2017 windows-10 mysql-connector
I made the mistake of upgrading to MySQL Connector C++ 8.0 and Visual Studio 2017.
I have followed the examples and I'm getting the error:
error LNK2019: unresolved external symbol "class sql::mysql::MySQL_Driver * __cdecl sql::mysql::get_driver_instance(void)" (?get_driver_instance@mysql@sql@@YAPAVMySQL_Driver@12@XZ)
Here's the code:
#include "gtest/gtest.h"
#include <sstream>
#include "mysql_connection.h"
#include <jdbc/mysql_connection.h>
#include <jdbc/mysql_driver.h>
// For resultset and statements:
//#include <jdbc/cppconn/resultset.h>
//#include <jdbc/cppconn/statement.h>
TEST(MySQL, Connection)
sql::Driver * driver = sql::mysql::get_driver_instance();
ASSERT_NE(driver, nullptr);
This is a function in Google test.
I have rebuilt the Connector C++ in folder C:mysql_connector_build
.
The Debug directory contains these files:
mysqlcppconn8.exp
mysqlcppconn8.lib
mysqlcppconn8-1-vs14.dll
mysqlcppconn8-1-vs14.ilk
mysqlcppconn8-1-vs14.pdb
try.exe
try.ilk
try.pdb
I have added the path "C:mysql_connector_buildDebug"
to the Linker->General->Additional Library Directories
.
I have added mysqlcppconn8.lib
to the Linker->Input->Additional Dependencies
.
I added "CPPCONN_PUBLIC_FUNC=" to the C++->Preprocessor->Preprocessor Definitions
.
Searching the internet for the error shows resolutions for earlier versions of MySQL Connector C++ 8.0.
The code is adapted from the examples at Connector/C++ 8.0 legacy C++ API based on JDBC4
I build the Connector C++ 8.0
library according to Using Connector/C++ 8.0.
Note: searching the internet came up with the result that there isn't a compatible binary library for Visual Studio 2017 on Windows 10. The GA version of the connector library is for Visual Studio 2015.
The question is: How do I resolve the external symbol error?
Please don't refer me to What is an undefined reference/unresolved external symbol error and how do I fix it? as my issue is more at where this symbol is defined (in which library) and not how to link a library.
c++ mysql visual-studio-2017 windows-10 mysql-connector
c++ mysql visual-studio-2017 windows-10 mysql-connector
asked Nov 10 at 19:49
Thomas Matthews
43.9k1168120
43.9k1168120
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53242806%2fmysql-get-driver-instance-not-found-with-connector-c-8-0%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown