Gecode(4.3.0)文档规定,在Mac上安装Gecode后,可以编译链接示例如下:
g++ -O3 -c money.cpp
g++ -framework gecode -o money money.o
编译成功但链接失败:
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
知道如何解决这个问题吗?