Łączenie z bazą danych

0

Witajcie!

Próbuję swoich sił z bazami danych w c++.

Ba, stanąłem przy dodawaniu biblioteki.

http://dev.mysql.com/downloads/installer/ - Z tej strony pobieram MySQL Connectors (zip), rozpakowuję, linkuję w visualu pliki lib i include.

Piszę przykładowo taki kod:

#include <mysql_connection.h>
#include <mysql_driver.h>
#include <mysql_error.h>
#include <iostream>

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

	driver = get_driver_instance();
} 

No i jest lipa bo wyskakuje masa błędów:

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)		cannot open source file "boost/shared_ptr.hpp"	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	31	

Error (active)		cannot open source file "boost/scoped_ptr.hpp"	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	32	

Error (active)		name followed by '::' must be a class or namespace name	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	175	

Error (active)		expected a ';'	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	175	

Error (active)		name followed by '::' must be a class or namespace name	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	179	

Error (active)		expected an identifier	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	179	

Error (active)		name followed by '::' must be a class or namespace name	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	181
	
Error (active)		expected an identifier	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	181	

Error (active)		cannot open source file "boost/scoped_ptr.hpp"	connect_to_database	c:\Programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_driver.h	30
	
Error	C1083	Cannot open include file: 'boost/shared_ptr.hpp': No such file or directory	connect_to_database	c:\programowanie\mysql-connector-c++-noinstall-1.1.7-win32\include\mysql_connection.h	31	

Domaga się bibliotek boost'a. Mam je pobrać i również podlinkować? Ma ktoś jakiś pomysł. :/

0

zainstalować boost'a

0

Nie wiem czemu nie chce mi bootstrapa wykonać. Już dwa razy ściągam boosta...

0

Zawartość bootstrap.log:

###
### Using 'vc14' toolset.
###

C:\boost_1_60_0\tools\build\src\engine>if exist bootstrap rd /S /Q bootstrap 

C:\boost_1_60_0\tools\build\src\engine>md bootstrap 

C:\boost_1_60_0\tools\build\src\engine>cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib /Febootstrap\jam0  command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c 
command.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
compile.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
constants.c
debug.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
execcmd.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
execnt.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
filent.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
frames.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
function.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
glob.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
hash.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
hdrmacro.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
headers.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
jam.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
jambase.c
jamgram.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
lists.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
make.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
make1.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
object.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
Generating Code...
Compiling...
option.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
output.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
parse.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
pathnt.c
c:\boost_1_60_0\tools\build\src\engine\strings.h(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
pathsys.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
regexp.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
rules.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
scan.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
search.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
subst.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
timestamp.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
variable.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
modules.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
strings.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
filesys.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
builtins.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
md5.c
md5.c(55): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
class.c
c:\boost_1_60_0\tools\build\src\engine\strings.h(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
cwd.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
w32_getreg.c
c:\boost_1_60_0\tools\build\src\engine\jam.h(34): fatal error C1083: Cannot open include file: 'ctype.h': No such file or directory
Generating Code...
Compiling...
native.c
c:\boost_1_60_0\tools\build\src\engine\strings.h(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
set.c
c:\boost_1_60_0\tools\build\src\engine\strings.h(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
path.c
c:\boost_1_60_0\tools\build\src\engine\strings.h(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
regex.c
c:\boost_1_60_0\tools\build\src\engine\modules\../mem.h(67): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
property-set.c
c:\boost_1_60_0\tools\build\src\engine\strings.h(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
sequence.c
c:\boost_1_60_0\tools\build\src\engine\strings.h(11): fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory
order.c
c:\boost_1_60_0\tools\build\src\engine\modules\../mem.h(67): fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory
Generating Code...

C:\boost_1_60_0\tools\build\src\engine>exit /b 2 
 

Dobra, dodałem po ludzku boost'a we właściwościach projektu. Zostały jakieś 2 błędy. Posiedzę nad tym rano. Postaram się sam je rozwiązać.

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