dbTalk Databases Forums  

help with mysql++ install on Mac OS 10.4.2

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss help with mysql++ install on Mac OS 10.4.2 in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brandon Woodson
 
Posts: n/a

Default help with mysql++ install on Mac OS 10.4.2 - 08-03-2005 , 11:57 AM






I successfully installed mysql++-2.0.0 using the
'--includedir=3D/usr/local/include/mysql++' and
'--with-mysql=3D/usr/local/mysql' switches (/usr/local/mysql is a sym
link to /usr/local/mysql-standard-4.1.11-apple-darwin7.8.0-powerpc if
that matter at all). I wrote a simple test program:

// Example 1

#include <iostream>
#include <mysql++.h>
#include <manip.h>

using namespace std;
using namespace mysqlpp;

int main() {
Connection con("serverstats", "127.0.0.1", "webdev", "webdevpass");

Query query =3D con.query();

query << "SELECT * FROM servers";

Result res =3D query.store();

cout << "Query: " << query.preview() << endl;

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;
for(i =3D res.begin(); i !=3D res.end(); i++) {
row =3D *i;
cout << setw(17) << row[0]
<< setw(4) << row[1]
<< setw(7) << row[2]
<< setw(7) << row[3]
<< row[4] << endl;
}

return 0;
}

When I try to compile with "g++ example.cpp -o example" I get these errors:

example.cpp:4:22: error: mysql++.h: No such file or directory
example.cpp:5:19: error: manip.h: No such file or directory
example.cpp:8: error: expected namespace-name before ';' token
example.cpp:8: error: '<type error>' is not a namespace
example.cpp: In function 'int main()':
example.cpp:11: error: 'Connection' was not declared in this scope
example.cpp:11: error: expected `;' before 'con'
example.cpp:13: error: 'Query' was not declared in this scope
example.cpp:13: error: expected `;' before 'query'
example.cpp:15: error: 'query' was not declared in this scope
example.cpp:17: error: 'Result' was not declared in this scope
example.cpp:17: error: expected `;' before 'res'
example.cpp:21: error: 'res' was not declared in this scope
example.cpp:23: error: 'Row' was not declared in this scope
example.cpp:23: error: expected `;' before 'row'
example.cpp:25: error: 'setw' was not declared in this scope
example.cpp:31: error: 'Result' is not a class or namespace
example.cpp:31: error: missing template arguments before 'i'
example.cpp:31: error: expected `;' before 'i'
example.cpp:32: error: 'i' was not declared in this scope
example.cpp:33: error: 'row' was not declared in this scope

Looking around it seems that the default place to look for header
files is /usr/include not /usr/local/include so I tried copying the
while mysql++ directory to /usr/include and that did nothing. I also
tried copying the entire contents of the mysql++ directory to
/usr/include and still the same error messages. What am I doing
wrong?

- Brandon

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.