dbTalk Databases Forums  

Another newbie here...

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


Discuss Another newbie here... in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brian Henning
 
Posts: n/a

Default Another newbie here... - 02-01-2006 , 08:21 AM






Hi List.
I'm new to using MySQL++, and not particularly experienced with
hugely complex projects.. So I hope everyone will be patient with me as
I ask a few really simple-minded questions. Pointers to reading
material are always appreciated as responses to my questions.

So here we go. I have a source file:

testmysql.cpp:

#include <stdio.h>
#include <mysql++.h>

int main (void) {

return 0;
}


That's it, seriously. Does absolutely nothing but exit with a zero
return value. And....it won't build under my minimal skillz.

% g++ -I/usr/local/include/mysql++ -o testmysql testmysql.cpp

results in (as you experienced folks might guess) a huge vomitous mass
of compiler errors.

So obviously even the inclusion of the mysql++.h header carries with it
a number of prerequisites I'm not meeting.

Understand that I have no experience with such things as projects where
tons of g++ command-line switches are being used. My above example
command line has been enough for the small projects I've worked on in
the past. I know nothing of the -Ms, the -gs, the -O2s (although at
least I know that last one has something to do with compiler
optimizations).. But I hate to think just using this library has turned
an otherwise innocuous project into more than I can chew. I really
think I can learn what I need to learn, but I don't know where to go to
find the info to learn it.

Would someone mind being patient enough to give me a bit of a
kick-start? I'd surely appreciate it.

Cheers and many thanks in advance,
~Brian

--
----------------
Brian A. Henning
strutmasters.com
336.597.2397x238
----------------

--
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
  #2  
Old   
Steve Povilaitis
 
Posts: n/a

Default RE: Another newbie here... - 02-01-2006 , 09:06 AM







Quote:
-----Original Message-----
From: Brian Henning [mailto:brian (AT) strutmasters (DOT) com]

% g++ -I/usr/local/include/mysql++ -o testmysql testmysql.cpp

results in (as you experienced folks might guess) a huge
vomitous mass of compiler errors.

Brian,

I'm using gcc on RHEL. These are some of the things I had to do to get my
stuff compiled:

1. Make sure I had all the necessary MySQL and MySQL ++ components:

a. Server
b. Client
c. Headers and Libraries
d. Shared Libraries


2. Had to run the following command to configure my shared libraries

/sbin/ldconfig /usr/local/lib

And add the following line to /etc/ld.so.conf

/usr/local/lib

3. In my makefile include the proper libs. For example I have the following
macro substitutions in my makefile:

# Specify include path for mySQL header files
CCFLAGS += -I/usr/include/mysql

# Specify include path for mySQL++ header files
CCFLAGS += -I/usr/local/include/mysql++

# Specify include path for mySQL client library
LDFLAGS += -L/usr/lib/mysql -lmysqlclient

# Specify include path for mySQL++ library
LDFLAGS += -L/usr/local/include/mysql++ -lmysqlpp

Hope this helps,

Steve


This e-mail and any attachments are provided through AEgis
Technologies' e-mail services and may contain company sensitive and/or
privileged information. If you are not the intended recipient, please
notify the sender immediately by return e-mail, delete this e-mail and
destroy any copies. Any dissemination or use of this information by a
person other than the intended recipient is unauthorized and may be
illegal.

--
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
  #3  
Old   
Warren Young
 
Posts: n/a

Default Re: Another newbie here... - 02-02-2006 , 05:08 AM



Brian Henning wrote:
Quote:
% g++ -I/usr/local/include/mysql++ -o testmysql testmysql.cpp
You're not linking to either the MySQL C API library, nor the MySQL++
API library. You must do both.

Rebuild the examples and observe the g++ commands given when you say 'make'.

--
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.