Ik heb dus net op VC++ 6.0, MySQL++ geinstalleerd
nu wanneer ik alleen al de examples probeer te compilen, geeft hij deze errors en warnings:
Dit is de code van het voorbeeld:
en dit is de code van convert1.hh: de file die de errors gaf:
Iemand een idee wat het kan zijn?
bvd
Wouter
nu wanneer ik alleen al de examples probeer te compilen, geeft hij deze errors en warnings:
ik heb op google en hier gezocht, maar daar blijken mensen alleen warnings te krijgen, maar het programma blijkt wel te werken. Dat is bij mij niet het geval.--------------------Configuration: examples - Win32 Release--------------------
Compiling...
simple1.cpp
../include\convert1.hh(40) : warning C4273: 'strtol' : inconsistent dll linkage. dllexport assumed.
../include\convert1.hh(41) : warning C4273: 'strtoul' : inconsistent dll linkage. dllexport assumed.
../include\convert1.hh(63) : error C2061: syntax error : identifier 'longlong'
../include\convert1.hh(64) : error C2061: syntax error : identifier 'longlong'
../include\convert1.hh(65) : error C2146: syntax error : missing ';' before identifier 'strtoll'
../include\convert1.hh(65) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
examples.exe - 4 error(s), 2 warning(s)
Dit is de code van het voorbeeld:
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| #include <iostream> #include <iomanip> #include <sqlplus.hh> int main() { Connection con("mysql_cpp_data"); // The full format for the Connection constructor is // Connection(cchar *db, cchar *host="", // cchar *user="", cchar *passwd="") // You may need to specify some of them if the database is not on // the local machine or you database username is not the same as your // login name, etc.. Query query = con.query(); // This creates a query object that is bound to con. query << "select * from stock"; // You can write to the query object like you would any other ostrem Result res = query.store(); // Query::store() executes the query and returns the results cout << "Query: " << query.preview() << endl; // Query::preview() simply returns a string with the current query // string in it. cout << "Records Found: " << res.size() << endl << endl; Row row; cout.setf(ios::left); cout << setw(17) << "Item" << setw(4) << "Num" << setw(7) << "Weight" << setw(7) << "Price" << "Date" << endl << endl; Result::iterator i; // The Result class has a read-only Random Access Iterator for (i = res.begin(); i != res.end(); i++) { row = *i; cout << setw(17) << row[0] << setw(4) << row[1] << setw(7) << row["weight"] // you can use either the index number or column name when // retrieving the colume data as demonstrated above. << setw(7) << row[3] << row[4] << endl; } return 0; } |
en dit is de code van convert1.hh: de file die de errors gaf:
C++:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
| #ifndef __convert1_hh__ #define __convert1_hh__ using namespace std ; #include <stdlib.h> #include "defs.h" template <class Type> class mysql_convert; #define mysql__convert(TYPE, FUNC) \ template <> \ class mysql_convert<TYPE> { \ private:\ TYPE num;\ public:\ mysql_convert(const char* str, const char *& end) { \ num = FUNC(str, const_cast<char **>(&end));}\ operator TYPE () {return num;}\ } \ //extern double strtod (const char *, char **); mysql__convert(float, strtod); mysql__convert(double, strtod); //----------------------------------------------------------------- #undef mysql__convert #define mysql__convert(TYPE, FUNC) \ template <> \ class mysql_convert<TYPE> {\ private:\ TYPE num;\ public:\ mysql_convert(const char* str, const char *& end) { \ num = FUNC(str, const_cast<char **>(&end),10);}\ operator TYPE () {return num;}\ }\ extern long strtol(const char *str, char **ptr, int base); extern unsigned long strtoul(const char *str, char **ptr, int base); mysql__convert(char, strtol); mysql__convert(signed char, strtol); mysql__convert(int, strtol); mysql__convert(short int, strtol); mysql__convert(long int, strtol); mysql__convert(unsigned char, strtoul); mysql__convert(unsigned int, strtoul); mysql__convert(unsigned short int, strtoul); mysql__convert(unsigned long int, strtoul); #ifndef NO_LONG_LONGS #ifdef strtoull #undef strtoull #endif #ifdef strtoll #undef strtoll #endif extern "C" { extern char *longlong2str(longlong val,char *dst,int radix); extern char *longlong10_to_str(longlong val,char *dst,int radix); extern longlong strtoll(const char *nptr,char **endptr,int base); extern ulonglong strtoull(const char *nptr,char **endptr,int base); } mysql__convert(longlong, strtoll); mysql__convert(ulonglong, strtoull); #endif #endif |
Iemand een idee wat het kan zijn?
bvd
Wouter
[ Voor 94% gewijzigd door Verwijderd op 07-07-2003 11:48 ]