0
Error   LNK1120 6 unresolved externals      
Error   LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::~SQLString(void)" (__imp_??1SQLString@sql@@QAE@XZ) referenced in function _main    
Error   LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::SQLString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0SQLString@sql@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main      
Error   LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::SQLString(char const * const)" (__imp_??0SQLString@sql@@QAE@QBD@Z) referenced in function _main        
Error   LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::operator class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &(void)const " (__imp_??BSQLString@sql@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function _main     
Error   LNK2019 unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall sql::SQLString::asStdString(void)const " (__imp_?asStdString@SQLString@sql@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "bool __cdecl sql::operator!=(class sql::SQLString const &,class sql::SQLString const &)" (??9sql@@YA_NABVSQLString@0@0@Z)   
Error   LNK2019 unresolved external symbol __imp__get_driver_instance referenced in function _main

This only happens while building the project not compiling

I've looked all over for a solution and just can't find one tried different libraries and all come out with this issue

#include "driver/mysql_connection.h"

#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
int main()
{
string Username;
string Pass;

try {
    sql::ResultSet *res;
    sql::ResultSet *res2;
    sql::Driver *driver;
    sql::Connection *con;
    sql::Statement *stmt;   


    bool loggingin = true;
    driver = get_driver_instance();
//place holder text not actualy there       
con = driver->connect("[host]", "[username]", "[password]");

    con->setSchema("Information");
    stmt = con->createStatement();
    res = stmt->executeQuery("Get Password where Username = '" + Username + "'");
    res2 = stmt->executeQuery("Get HWID where Username = '" + Username + "'");
    while (loggingin) {
        printf("Please Type Your Username: \n >>");
        cin >> Username;
        printf("Please Type Your Password: \n >>");
        cin >> Pass;




        res = stmt->executeQuery("Get Password where Username = '" + Username + "'");

        string password = res->getString(1);
        ;

        while (res->next()) {
            if (res->getRow() == 0 || password != Pass) {
                printf("Username or Password Wrong");

            }
            else {

                if (res2->getString(1) != getHWID()) {
                    exit(1);

                }
                else {
                    loggingin = false;


                }

            }

            break;
        }


    }
    delete con;
    delete res;
    delete res2;

    delete stmt;
}
catch (sql::SQLException &e) {

    system("cls");
    printf("please reload");
    while (true) {
        Sleep(1);

    }
}

I just want it to build there are no other issues just it cant build

shadowsheep
  • 14,048
  • 3
  • 67
  • 77
Hladenz
  • 1
  • 2

1 Answers1

0

Fixed by adding mysqlcppconn.lib and mysqlcppconn-static.lib to Linker>Input>Additional Dependancy

Hladenz
  • 1
  • 2