3 messages in com.mysql.lists.plusplusRE: building my own application| From | Sent On | Attachments |
|---|---|---|
| AJ Coon | 19 Dec 2001 05:22 | |
| S. David Sheeks | 19 Dec 2001 13:14 | |
| Arren Mund | 19 Dec 2001 14:42 |
| Subject: | RE: building my own application![]() |
|---|---|
| From: | S. David Sheeks (sdsh...@isdponline.com) |
| Date: | 12/19/2001 01:14:38 PM |
| List: | com.mysql.lists.plusplus |
I simply did
make simple1.cpp > mymakefile from the examples dir...this worked just fine for me..that gave me the commands I needed to create my 'make' and i modified it so I didn't have to have it under the examples directory...
dave
-----Original Message----- From: AJ Coon [mailto:aj...@rivar.com] Sent: Wednesday, December 19, 2001 8:23 AM To: plus...@lists.mysql.com Subject: building my own application
Hi. I have been working with MySQL from a DBA perspective for over a year now. I'm also a *decent* C++ coder. However I'm new to MySQL++, and I cannot seem to find documentation for my question, so I'm giving it to the list to answer for me.
I wrote my own test application, just to get acquainted with the API and build process. The coding was rather easy. Linking, however, is getting to be a bit painful. I've worked with static (.a) and shared (.so) libs before with C/C++, but this *libtool* program is new to me. How can i write a simple makefile target that compiles my .cpp file and then links against the mysql libs? this is what i've tried:
all :
c++ -DHAVE_CONFIG_H -I/home/aj/packages/mysql++-1.7.9/sqlplusint -I/usr/loca l/mysql/include/mysql -g -O2 -c easy.cpp /bin/sh libtool --mode=link c++ -g -O2 -L/usr/local/mysql/lib/mysql -o easy easy.o /home/aj/packages/mysql++-1.7.9/sqlplusi nt/libsqlplus.la -lz -lmysqlclient
That COMPILES and LINKS with no errors, no warnings. But here are my two problems:
1. I would rather not learn two things at once right now (MySQL++ & libtool). Is there any way I can use MySQL++ as an .so? 2. When I run easy (my application), I get this error:
lt-easy: error while loading shared libraries: cannot open shared object file: cannot load shared object file: No such file or directory
Well, what is "lt-easy"? I ran a program called easy!?!! Again, this must be part of this libtool crap. And what .so is it looking for?
I'm not a happy camper. Someone please help me get out of my funk here...
thanks,




