BYVoid / OpenCC

Conversion between Traditional and Simplified Chinese
https://opencc.byvoid.com/
Apache License 2.0
8.3k stars 974 forks source link

1.1.7版本ld链接报错 #836

Open 6HuangShi opened 7 months ago

6HuangShi commented 7 months ago

源码编译1.1.7,生成静态库libopencc.a 使用程序去链接静态库时,有下面的报错 /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in function opencc::MarisaDict::Match(char const*, unsigned long) const': MarisaDict.cpp:(.text+0x1c8): undefined reference tomarisa::Agent::Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x1d8): undefined reference to marisa::Agent::set_query(char const*, unsigned long)' /usr/bin/ld: MarisaDict.cpp:(.text+0x1e8): undefined reference tomarisa::Trie::lookup(marisa::Agent&) const' /usr/bin/ld: MarisaDict.cpp:(.text+0x240): undefined reference to marisa::Agent::~Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x254): undefined reference tomarisa::Agent::~Agent()' /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in function opencc::MarisaDict::MatchPrefix(char const*, unsigned long) const': MarisaDict.cpp:(.text+0x29c): undefined reference tomarisa::Agent::Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x2c0): undefined reference to marisa::Agent::set_query(char const*, unsigned long)' /usr/bin/ld: MarisaDict.cpp:(.text+0x2d4): undefined reference tomarisa::Trie::common_prefix_search(marisa::Agent&) const' /usr/bin/ld: MarisaDict.cpp:(.text+0x340): undefined reference to marisa::Agent::~Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x354): undefined reference tomarisa::Agent::~Agent()' /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in function opencc::MarisaDict::MatchAllPrefixes(char const*, unsigned long) const': MarisaDict.cpp:(.text+0x3a0): undefined reference tomarisa::Agent::Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x3c4): undefined reference to marisa::Agent::set_query(char const*, unsigned long)' /usr/bin/ld: MarisaDict.cpp:(.text+0x3dc): undefined reference tomarisa::Trie::common_prefix_search(marisa::Agent&) const' /usr/bin/ld: MarisaDict.cpp:(.text+0x454): undefined reference to marisa::Agent::~Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x478): undefined reference tomarisa::Agent::~Agent()' /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in function opencc::MarisaDict::NewFromFile(_IO_FILE*)': MarisaDict.cpp:(.text+0x5fc): undefined reference tomarisa::fread(_IO_FILE, marisa::Trie)' /usr/bin/ld: MarisaDict.cpp:(.text+0x62c): undefined reference to marisa::Agent::Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x640): undefined reference tomarisa::Agent::set_query(char const)' /usr/bin/ld: MarisaDict.cpp:(.text+0x68c): undefined reference to marisa::Trie::predictive_search(marisa::Agent&) const' /usr/bin/ld: MarisaDict.cpp:(.text+0x808): undefined reference tomarisa::Agent::~Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0x8bc): undefined reference to marisa::Agent::~Agent()' /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in functionopencc::MarisaDict::NewFromDict(opencc::Dict const&)': MarisaDict.cpp:(.text+0x94c): undefined reference to marisa::Keyset::Keyset()' /usr/bin/ld: MarisaDict.cpp:(.text+0x9c8): undefined reference tomarisa::Keyset::push_back(char const)' /usr/bin/ld: MarisaDict.cpp:(.text+0xa98): undefined reference to marisa::Trie::build(marisa::Keyset&, int)' /usr/bin/ld: MarisaDict.cpp:(.text+0xaa0): undefined reference tomarisa::Agent::Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0xab4): undefined reference to marisa::Agent::set_query(char const*)' /usr/bin/ld: MarisaDict.cpp:(.text+0xafc): undefined reference tomarisa::Trie::predictive_search(marisa::Agent&) const' /usr/bin/ld: MarisaDict.cpp:(.text+0xc28): undefined reference to marisa::Agent::~Agent()' /usr/bin/ld: MarisaDict.cpp:(.text+0xcc4): undefined reference tomarisa::Agent::~Agent()' /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in function opencc::MarisaDict::SerializeToFile(_IO_FILE*) const': MarisaDict.cpp:(.text+0xd7c): undefined reference tomarisa::fwrite(_IO_FILE, marisa::Trie const&)' /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in function opencc::MarisaDict::MarisaInternal::MarisaInternal()': MarisaDict.cpp:(.text._ZN6opencc10MarisaDict14MarisaInternalC2Ev[_ZN6opencc10MarisaDict14MarisaInternalC5Ev]+0x24): undefined reference tomarisa::Trie::Trie()' /usr/bin/ld: /home/tyq/ctcc/code/third-lib/opencc/libopencc.a(MarisaDict.cpp.o): in function `std::default_delete::operator()(marisa::Trie) const': MarisaDict.cpp:(.text._ZNKSt14defaultdeleteIN6marisa4TrieEEclEPS1[_ZNKSt14defaultdeleteIN6marisa4TrieEEclEPS1]+0x24): undefined reference to `marisa::Trie::~Trie()'

6HuangShi commented 7 months ago

armv8架构环境