[gecode-users] failed to link with branch

Marco Correia marco.v.correia at gmail.com
Thu Jul 11 00:29:17 CEST 2013


On Jul 10, 2013, at 23:19 , Ronen Shouker <rshouker at gmail.com> wrote:

> 
>> [snip] 
>> ... I have one error during link:
>> 
>> Undefined symbol 'Gecode::branch(
>>  [snip]
>>    std::__1::basic_ostream<char,std::__1::char_traits<char> >&
>>  [snip]
>> 
> 
> After using nm to inspect the dylib:
> it seems that those __1:: that for some reason appear in the error message
> (and therefore where produced by the compiler) are not in the gecode dylib.
> 
> Any Clues?

(Disclaimer:  I am not a Gecode expert)

I suspect the problem is the c++ standard library. With clang (the new c++ compiler shipped with mac os) comes a new c++ standard lib, which you can link to by specifying -stdlib=libc++ when compiling/linking you code. To link with the old c++ standard lib you compile with -stdlib=libstdc++ instead.

I suspect you compiled gecode with one of them are now are trying to compile your example with the other one.


More information about the users mailing list