MySQL Connector - Błąd

0

Witam. Mam pewien problem, mianowicie muszę stworzyć aplikację łączącą się z bazą danych. Pobrałem wszystkie wersje - http://scr.hu/3dxp/97zcl
Dodawałem wszystko niestety dostaje błędy, te są z wersji 32 bit no install ale wszystkie są podobne

Error	11	error LNK2019: unresolved external symbol __imp__get_driver_instance referenced in function _main	C:\Users\Sebek\documents\visual studio 2012\Projects\Cheat - Arielus\Arielus.pl_Client\Source.obj	Arielus.pl_Client
Error	10	error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __thiscall sql::SQLException::getErrorCode(void)const " (__imp_?getErrorCode@SQLException@sql@@QBEHXZ) referenced in function __catch$_main$0	C:\Users\Sebek\documents\visual studio 2012\Projects\Cheat - Arielus\Arielus.pl_Client\Source.obj	Arielus.pl_Client
Error	8	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 "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class sql::SQLString const &)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@ABVSQLString@sql@@@Z)	C:\Users\Sebek\documents\visual studio 2012\Projects\Cheat - Arielus\Arielus.pl_Client\Source.obj	Arielus.pl_Client
Error	9	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::SQLException::getSQLState(void)const " (__imp_?getSQLState@SQLException@sql@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function __catch$_main$0	C:\Users\Sebek\documents\visual studio 2012\Projects\Cheat - Arielus\Arielus.pl_Client\Source.obj	Arielus.pl_Client
Error	7	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	C:\Users\Sebek\documents\visual studio 2012\Projects\Cheat - Arielus\Arielus.pl_Client\Source.obj	Arielus.pl_Client
Error	6	error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::~SQLString(void)" (__imp_??1SQLString@sql@@QAE@XZ) referenced in function _main	C:\Users\Sebek\documents\visual studio 2012\Projects\Cheat - Arielus\Arielus.pl_Client\Source.obj	Arielus.pl_Client
Error	12	error LNK1120: 6 unresolved externals	C:\Users\Sebek\documents\visual studio 2012\Projects\Cheat - Arielus\Debug\Arielus.pl_Client.exe	Arielus.pl_Client

Nie mam pojęcia o co chodzi. Tego kodu używałem przy bibliotekach c:

#include <my_global.h>
#include <mysql.h>

int main(int argc, char **argv)
{
  printf("MySQL client version: %s\n", mysql_get_client_info());

  exit(0);
}

A tego przy c++:

#include "mysql_connection.h"
#include <cppconn/driver.h>

int main(void)
{
	sql::Driver *driver;
	sql::Connection *con;

	driver = get_driver_instance();
	con = driver->connect("tcp://127.0.0.1:3306", "root", "root");

	return 0;
}

http://scr.hu/3dxp/v4yid
http://scr.hu/3dxp/jthyz

Visual odnajduje biblioteki. Ktoś wie o co tu może chodzić?

0

Miałem ten sam problem kiedyś. Ściągnij 32 bitową wersję connectora.

0

Przeczytałeś dokładnie? Pobrałem wszystkie wersje, instalacyjne, do wypakowania, dla c i c++, 32 i 64 bitowe.

0

Naprawione, wystarczyło dodać E:\MySQL C++ 32 bit\lib\opt\mysqlcppconn-static.lib;E:\MySQL C++ 32 bit\lib\opt\mysqlcppconn.lib additional dependencies :)

1 użytkowników online, w tym zalogowanych: 0, gości: 1