[odb-users] libc++abi.dylib: terminating with uncaught foreign exception

Adnan RIHAN axel50397 at gmail.com
Sat Oct 18 03:08:21 EDT 2014


On 16 octobre 2014 at 13:23:17, Boris Kolpackov (boris at codesynthesis.com
(mailto:boris at codesynthesis.com)) wrote:

> > - libodb* _must_ be compiled with GCC (Or else, compilation errors,
> > see above link)
>
> No, you should be able to build them (and your application) with Clang.
> The fact that you weren't able to figure out why the Clang build fails
> doesn't mean that everything "must" be built with GCC.

I was exposing MY situation, not in general. To make everything work in my
case, I have to start from a working state.

> > - App _must_ be compiled with GCC (Or else, runtime error related to
> > libc++abi)

Here again, it’s MY case, I wasn’t meaning in general.

I have to admit that I need to go forward on my project, but I also want to
sort this out. I’ve tried many combination, without success. I could blame
Qt/Qt-Creator but the errors were related to sqlite.

I’ve even just tried to compile “hello” example by command line, using
clang-c++:
> ➜  hello  pwd
> /Users/Max13/Downloads/odb-examples-2.3.0/hello
> ➜  hello  c++ -v
> Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
> Target: x86_64-apple-darwin13.4.0
> Thread model: posix
> ➜  hello  odb -d sqlite --generate-query --generate-schema person.hxx
> ➜  hello  c++ -c person-odb.cxx
> ➜  hello  c++ -DDATABASE_SQLITE -c driver.cxx
> ➜  hello  c++ -o driver driver.o person-odb.o -lodb-sqlite -lodb
> Undefined symbols for architecture x86_64:
>   "odb::schema_catalog::create_schema(odb::database&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&, bool)", referenced from:
>       create_database(int&, char**) in driver.o
>   "odb::sqlite::query_base::append(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)",
referenced from:
>       odb::sqlite::query_base::operator+=(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in driver.o
>       odb::sqlite::query_base::operator+=(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in
person-odb.o
>
"odb::sqlite::delete_statement::delete_statement(odb::sqlite::connection&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&, odb::sqlite::binding&)", referenced
from:
>       odb::access::object_traits_impl<person,
(odb::database_id)1>::erase_query(odb::database&, odb::sqlite::query_base
const&) in person-odb.o
>
"odb::sqlite::select_statement::select_statement(odb::sqlite::connection&,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&, bool, bool, odb::sqlite::binding&,
odb::sqlite::binding&)", referenced from:
>       odb::access::object_traits_impl<person,
(odb::database_id)1>::query(odb::database&, odb::sqlite::query_base const&)
in person-odb.o
>       odb::access::view_traits_impl<person_stat,
(odb::database_id)1>::query(odb::database&, odb::sqlite::query_base const&)
in person-odb.o
>   "odb::sqlite::default_value_traits<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
(odb::sqlite::database_type_id)2>::set_image(odb::details::basic_buffer<char>&,
unsigned long&, bool&, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)",
referenced from:
>       odb::access::object_traits_impl<person,
(odb::database_id)1>::init(odb::access::object_traits_impl<person,
(odb::database_id)1>::image_type&, person const&,
odb::sqlite::statement_kind) in person-odb.o
>   "odb::sqlite::database::print_usage(std::__1::basic_ostream<char,
std::__1::char_traits<char> >&)", referenced from:
>       create_database(int&, char**) in driver.o
>   "odb::sqlite::database::database(int&, char**, bool, int, bool,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&,
odb::details::transfer_ptr<odb::sqlite::connection_factory>)", referenced
from:
>       create_database(int&, char**) in driver.o
> ld: symbol(s) not found for architecture x86_64
> clang: error: linker command failed with exit code 1 (use -v to see
invocation)

Compiled with c++-4.9, no error.

Maybe it’s related to my system... The thing is that I’ve completely
reinstalled my system on 10.9 (Maverick), the only system “things” I’ve
reinstalled is Xcode, Qt (isolated) and homebrew (isolated but touches
$PATH).
I don’t know what could I check more...

While writing this email, something strange happened, the lib compiled with
GCC and my app with clang, no more runtime errors... I don't understand,
same code, same environment and no more libc++/glibc. So I got 2 ideas to
check to determine where it could come from:
1- Make a clean partition, install nothing on it but the required lib (gcc,
xcode, odb, libodb, ...) then try and log environment combinations (because
the libc++abi error shouldn't have disappeared)
2- Try with another db driver, because so far I've only tried libodb-sqlite.

Then I'll be back to you to keep you updated. Yosemite (10.10) is now final
and released, i'll also check on this system.

Thanks for your help.
-- 
Cordialement, Adnan RIHAN.
Directeur-Gérant de Eolis-Software, société de services informatiques.

GPG: 5675-62BA (https://keybase.io/max13/key.asc)
-> Si vous n'utilisez pas GPG mais souhaitez quand même m’envoyer un e-mail
chiffré: (https://encrypt.to/0x567562BA).


More information about the odb-users mailing list