Hello, I'm trying to compile examples from Gecode 4.3.0 on a Mac OS X (Mavericks 10.9.5) with g++ (Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0).
I started with the simplest route, i.e download the 4.3.0 dmg file which according to the site contains everything needed (including Qt libs). Then, following the 'Modeling and Programming with Gecode' installation instructions for Apple Mac OS issued a: g++ -O3 -c money.cpp so far, so good. Followed this with a g++ -framework gecode -o money money.cpp At this point the linker got angry and threw this at me: ----------------- Undefined symbols for architecture x86_64: "Gecode::Gist::TextOutput::TextOutput(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: void Gecode::Driver::ScriptBase<Gecode::Space>::runMeta<Money, Gecode::DFS, Gecode::Options, Gecode::Driver::EngineToMeta>(Gecode::Options const&, Money*) in money.o void Gecode::Driver::ScriptBase<Gecode::Space>::runMeta<Money, Gecode::DFS, Gecode::Options, Gecode::RBS>(Gecode::Options const&, Money*) in money.o "Gecode::Driver::stop(Gecode::Support::Timer&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from: void Gecode::Driver::ScriptBase<Gecode::Space>::runMeta<Money, Gecode::DFS, Gecode::Options, Gecode::Driver::EngineToMeta>(Gecode::Options const&, Money*) in money.o void Gecode::Driver::ScriptBase<Gecode::Space>::runMeta<Money, Gecode::DFS, Gecode::Options, Gecode::RBS>(Gecode::Options const&, Money*) in money.o "Gecode::branch(Gecode::Home, Gecode::IntVarArgs const&, Gecode::IntVarBranch, Gecode::IntValBranch, bool (*)(Gecode::Space const&, Gecode::IntVar, int), void (*)(Gecode::Space const&, Gecode::BrancherHandle const&, unsigned int, Gecode::IntVar, int, int const&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&))", referenced from: Money::Money(Gecode::Options const&) in money.o ld: symbol(s) not found for architecture x86_64 ----------------- Suspecting this is Qt related, I tried various things including compiling from XCode but to no avail, so at this point decided to try building it from the sources. At first I tried the ./configure, make path but after compiling a few files this failed with compilation error due to not finding some header file of Qt (I don't recall which now), though I have the latest Qt SDK installed. So I decided to try the cmake route. Here, the compilation completed with no errors. I then ollowed the last thread about problems compiling 4.3.0 on OS/X and used the following to link: g++ -o money money.o -L/Users/amnondavid/Downloads/gecode-4.3.0/ -O3 -lgecodeflatzinc -lgecodedriver -lgecodesearch -lgecodeminimodel -lgecodeset -lgecodefloat -lgecodeint -lgecodekernel -lgecodesupport but again, received a set of linking errors starting with: "Gecode::Gist::Comparator::~Comparator()", referenced from: void Gecode::Driver::ScriptBase<Gecode::Space>::runMeta<Money, Gecode::DFS, Gecode::Options, Gecode::Driver::EngineToMeta>(Gecode::Options const&, Money*) in money.o void Gecode::Driver::ScriptBase<Gecode::Space>::runMeta<Money, Gecode::DFS, Gecode::Options, Gecode::RBS>(Gecode::Options const&, Money*) in money.o Gecode::Gist::VarComparator<Money>::~VarComparator() in money.o non-virtual thunk to Gecode::Gist::VarComparator<Money>::~VarComparator() in money.o Gecode::Gist::VarComparator<Money>::~VarComparator() in money.o non-virtual thunk to Gecode::Gist::VarComparator<Money>::~VarComparator() in money.o "Gecode::Gist::TextOutput::init()", referenced from: Gecode::Gist::VarComparator<Money>::compare(Gecode::Space const&, Gecode::Space const&) in money.o Gecode::Gist::Print<Money>::inspect(Gecode::Space const&) in money.o I figured what is needed is adding -lgecodegist, but looking at the generated libraries, I noticed the cmake process didn't generate it. Again, I assume due to not finding Qt (although I have the libraries installed). Having installed Gecode on my Mac a couple of years ago and doing some cool things with it , I'd like to get the latest version, though instead of spending a few more hours (or days) tracking this down, perhaps one of the gurus here could solve it in 5 minutes... Thanks, Amnon
_______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users