List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:May 13 2009 2:40pm
Subject:Re: Xcode 3.1.3 cannot build and hard crash in example
View as plain text  
On May 13, 2009, at 4:17 AM, Jean-Denis Muys wrote:

> The problem is that the provided Xcode project file fails to build.

No big surprise there: you're probably the first to try it.  You're  
certainly the first to try it and then report what happened.  Xcode  
support is something we're just supposed to get for free from  
Bakefile, but clearly it needs more work.  I imagine most Mac OS X  
users of MySQL++ are building from the command line.  I know I am.

> 2- The modified Xcode project now compiles OK, but fails at link time,
> because the linker doesn't find 38 symbols, such as:
> "_mysql_escape_string",  "_mysql_real_escape_string",
>  "_mysql_next_result",   "_mysql_thread_id",   "_mysql_shutdown",
> "_mysql_errno",   "_mysql_error",   "_mysql_stat",
>  "_mysql_info",  "_mysql_init",  "_mysql_select_db", etc…
> These symbols seems to be from mySQL C API


> I tried to work around that by adding
> /usr/local/mysql/lib to the library search paths and the following  
> option to
> Other link flags: -llibmysqlclient

The link flag needs to be -lmysqlclient.  Unixy linkers assume the  
"lib" prefix.

> However, the standard make procedure (AFAICS), doesn't build the  
> examples.

Sure it does.  Perhaps you haven't yet read README-examples.txt?

> The stack crawl is
> #0    0x000fa6e1 in __gnu_cxx::__exchange_and_add
> #1    0x000c4ac4 in std::locale::_Impl::_M_replace_category
> #2    0x000c42fa in std::locale::operator=
> #3    0x000c3f1e in std::ios_base::_M_init
> #4    0x000cf207 in std::basic_ios<char, std::char_traits<char>  
> >::init
> #5    0x0006f084 in OptionalExceptions [inlined] at noexceptions.h:45
> #6    0x0006f084 in mysqlpp::Query::Query at query.cpp:45
> #7    0x00060808 in mysqlpp::Connection::query at connection.cpp:264

I don't know what's going on here.  Wild guess: you're using the wrong  
build options in your project, differing in some key way from the way  
the library is built, so that the RTL crashes when you try to call  
across the boundary.

Try the examples first.  Once you prove to yourself that the code can  
work, you can work on building something functional through Xcode.

> Is that crash really a bug

Surely if the library was so horribly broken that you can't even  
construct a Query object, someone would have reported it by now.
Xcode 3.1.3 cannot build and hard crash in exampleJean-Denis Muys13 May
  • Re: Xcode 3.1.3 cannot build and hard crash in exampleWarren Young13 May