Thanks for the input, Warren and Ovidiu!
--- Warren Young <mysqlpp@stripped> wrote:
> J Robinson wrote:
>
> > My program (ported from linux to OSX)
>
> I have yet to get a success report on OS X, so there
> may well be things
> that have to be done to the library to get it to
> work.
>
> > ZeroLink: unknown symbol '__ZTVN7mysqlpp3RowE'
>
> That's the only message? I would think you'd get a
> bunch of similar
> messages as well.
>
Nope, just that one -- reproducibly. But I think the
linker may just be showing the first one.
I forgot to mention in my last post that I'm using
Xcode to build and maintain the project. If need be I
can try it with straight Makefiles (ack).
> > What am I doing wrong? Do I need to set
> > LD_LIBRARY_PATH or LDFLAGS or something? (I tried
> > those things but it didn't seem to make a
> difference).
>
> Do the examples compile and run?
Yeah, they do! (And I'm using the OSX binary install
version of mysql - it does contain libmysqlclient.a,
but no libmysqlclient.dylib).
This is on OS X 10.3.6 using MySQL 4.0.22. The
examples were built and tested from the command line,
but my app's being built using Xcode.
On a related note, I found that under Xcode, I'm
unable to get the following code to run:
#include <iostream>
#include <mysql++.h>
#include <string_util.h>
int main (int argc, char * const argv[]) {
// insert code here...
std::cout << "Hello, World!\n";
std::string s = "34j2l4j//&*";
mysqlpp::escape_string(s);
std::cout << s;
return 0;
}
If I build in 'deployment' mode, I get:
...
ld: warning prebinding disabled because dependent
library: /usr/local/lib/libmysqlpp.3.dylib is not
prebound
ld: Undefined symbols:
mysqlpp::escape_string(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)
and the program won't start.
If I build in 'development' mode, the program starts,
but at runtime I get:
Hello, World!
ZeroLink: unknown symbol
'__ZN7mysqlpp13escape_stringERSs'
(hm, same symbol as above apparently)
I'm still bangin' my head against this. The relevant
config options from Xcode are:
HEADER SEARCH PATHS: /usr/local/include
/usr/local/mysql/include
LIBRARY SEARCH PATHS: /usr/local/mysql/lib
/usr/local/lib
OTHER LINKER FLAGS: -lmysqlpp -lmysqlclient
/usr/local/lib/libmysqlpp.a
What's going wrong?
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail