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.










share|improve this question

























    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.










    share|improve this question























      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.










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 19:49









      Thomas Matthews

      43.9k1168120




      43.9k1168120



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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





















































          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







          這個網誌中的熱門文章

          Barbados

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3