[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

linke mod mysqlcppapi



Hej,
Jeg har hentet og installeret mysqlcppapi som giver mulighed for at snakke 
med en mysql database via c++.

Der er nogle eksempler med som den bygger fint via den Makefile der følger 
med, der kører bare perfekt.
Når man køre make install på den, er der så et sted hvor den siger 
----------------------------------------------------------------------
chmod 644 /usr/local/lib/libmysqlcppapi.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'
-------------------------------------
Ok så langt så godt.
Jeg har tilføjet /usr/local/lib til /etc/ld.so.conf og kørt ldconfig

Jeg vil gerne kunne starte helt "from scratch" med min egen hello.cc fil 
men jeg ved ikke hvordan jeg får den til at kompilere.
(hello.cc er en kopi af en af eksempel-filerne)
Hvad skal jeg give af options for at bygge den ?

Jeg vil selvfølgelig gerne ende med at have min egen Makefile på et 
tidspunkt, men når jeg kigger på den der følger med får jeg det helt 
dårligt.

Jeg har desperat prøvet at skrive
c++ -g -O2  -I/usr/include/mysql/ -I/usr/local/lib/ -L/usr/local/lib 
simple1.cc

Det giver en stribe af fejl:
/tmp/ccHAB6uF.o: In function `__default_alloc_template<true, 
0>::_S_chunk_alloc(unsigned int, int &)':
/usr/include/g++-3/stl_alloc.h:466: undefined reference to 
`mysqlcppapi::Connection::Connection(void)'
/usr/include/g++-3/stl_alloc.h:490: undefined reference to 
`mysqlcppapi::Connection::set_Host(basic_string<char, 
string_char_traits<char>, __default_alloc_template<true, 0> > const &)'
osv. osv

Den kender åbenbart intet til de kald som mysqlcppapi bruger.

Hvordan får jeg det til at virke ?
Tak,

-- 
Dennis Hansen <sslug@sslug>
Linux - Because I'm worth it



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *