linking issues #206
Replies: 1 comment
-
My typical development environment is MacOS M1 (arm64) and haven't had any problems compiling and linking with clang. I've verified that Check with $ nm -gU lib/libreflex.a
lib/libreflex.a(convert.o):
0000000000006af4 T __ZN6reflex11regex_errorC1EiPKcm
000000000000a4c4 T __ZN6reflex11regex_errorD0Ev
0000000000006b90 T __ZN6reflex11regex_errorD1Ev
...
lib/libreflex.a(matcher.o):
000000000000c9e8 T __ZN6reflex14PatternMatcherINS_7PatternEE7patternEPKS1_
000000000000ca3c T __ZN6reflex14PatternMatcherINS_7PatternEE7patternEPKc
000000000000cabc T __ZN6reflex14PatternMatcherINS_7PatternEE7patternERKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE
000000000000c994 T __ZN6reflex14PatternMatcherINS_7PatternEE7patternERKS1_
000000000000c0c4 T __ZN6reflex14PatternMatcherINS_7PatternEE7patternERKS2_
...
lib/libreflex.a(pattern.o):
00000000000001e0 T __ZN6reflex11regex_errorC1EiRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEm
0000000000012628 T __ZN6reflex11regex_errorD0Ev
0000000000000288 T __ZN6reflex11regex_errorD1Ev
000000000001526c T __ZN6reflex6RangesIjE6insertERKjS3_
0000000000013cc8 T __ZN6reflex6RangesIjEoRERKS1_
0000000000016478 T __ZN6reflex6RangesItE6insertERKtS3_
0000000000016c58 T __ZN6reflex6RangesItEoRERKS1_
00000000000131e4 T __ZN6reflex7ORangesIjEmIERKS1_
000000000000d774 T __ZN6reflex7Pattern10encode_dfaEPNS0_3DFA5StateE
000000000000aa80 T __ZN6reflex7Pattern11analyze_dfaEPNS0_3DFA5StateE
000000000000d540 T __ZN6reflex7Pattern11compact_dfaEPNS0_3DFA5StateE
00000000000011d8 T __ZN6reflex7Pattern12init_optionsEPKc
000000000000a5b0 T __ZN6reflex7Pattern13gen_match_hfaEPNS0_3DFA5StateE
... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I installed RE-flex on macos using homebrew. I use g++-14 from homebrew.
I'm trying to link in the generated code in my app with the reflex library, but I get errors:
Undefined symbols for architecture arm64:
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::at(unsigned long) const", referenced from:
reflex::Pattern::graph_dfa(reflex::Pattern::DFA::State const*) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::gencode_dfa(reflex::Pattern::DFA::State const*) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::export_code() const in libreflex.a(libreflex_a-pattern.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::find(char, unsigned long) const", referenced from:
reflex::Pattern::init_options(char const*) in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::parse4(bool, unsigned int&, std::__1::vector<reflex::Pattern::Position, std::__1::allocatorreflex::Pattern::Position>&, std::__1::vector<reflex::Pattern::Position, std::__1::allocatorreflex::Pattern::Position>&, bool&, std::__1::map<reflex::Pattern::Position, std::__1::vector<reflex::Pattern::Position, std::__1::allocatorreflex::Pattern::Position>, std::__1::lessreflex::Pattern::Position, std::__1::allocator<std::__1::pair<reflex::Pattern::Position const, std::__1::vector<reflex::Pattern::Position, std::__1::allocatorreflex::Pattern::Position>>>>&, unsigned char&, std::__1::vector<reflex::Pattern::Position, std::__1::allocatorreflex::Pattern::Position>&, reflex::ORanges, reflex::ORanges&, unsigned short&) in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::compile_list(unsigned int, reflex::Pattern::Chars&, reflex::ORanges const) const in libreflex.a(libreflex_a-pattern.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::compare(unsigned long, unsigned long, char const*) const", referenced from:
reflex::Pattern::parse_esc(unsigned int&, reflex::Pattern::Chars*) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::compile_list(unsigned int, reflex::Pattern::Chars&, reflex::ORanges const*) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::graph_dfa(reflex::Pattern::DFA::State const*) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::gencode_dfa(reflex::Pattern::DFA::State const*) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::export_code() const in libreflex.a(libreflex_a-pattern.o)
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::__1::ios_base::getloc() const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&)", referenced from:
reflex::regex_error::regex_error(int, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::bad_array_new_length::bad_array_new_length()", referenced from:
std::__throw_bad_array_new_lengthabi:v15006 in libreflex.a(libreflex_a-matcher.o)
std::__throw_bad_array_new_lengthabi:v15006 in libreflex.a(libreflex_a-pattern.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::append(char const*)", referenced from:
reflex::regex_error::regex_error_message(char const*, char const*, unsigned long) in libreflex.a(libreflex_a-error.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::append(char const*, unsigned long)", referenced from:
reflex::regex_error::regex_error_message(char const*, char const*, unsigned long) in libreflex.a(libreflex_a-error.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::append(unsigned long, char)", referenced from:
reflex::regex_error::regex_error_message(char const*, char const*, unsigned long) in libreflex.a(libreflex_a-error.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&)", referenced from:
reflex::Pattern::Pattern(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, char const*) in libreflex.a(libreflex_a-matcher.o)
reflex::Pattern::operator[](unsigned int) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::init_options(char const*) in libreflex.a(libreflex_a-pattern.o)
void std::__1::vector<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>>>::__push_back_slow_path<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&>(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&) in libreflex.a(libreflex_a-pattern.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::basic_string(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&, unsigned long, unsigned long, std::__1::allocator const&)", referenced from:
reflex::Pattern::operator[](unsigned int) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::write_namespace_open(__sFILE*) const in libreflex.a(libreflex_a-pattern.o)
reflex::Pattern::write_namespace_close(__sFILE*) const in libreflex.a(libreflex_a-pattern.o)
"std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator>::operator=(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator> const&)", referenced from:
reflex::Pattern::init_options(char const*) in libreflex.a(libreflex_a-pattern.o)
"std::__1::basic_istream<char, std::__1::char_traits>::get()", referenced from:
reflex::Input::get(char*, unsigned long) in libreflex.a(libreflex_a-matcher.o)
"std::__1::basic_istream<char, std::__1::char_traits>::read(char*, long)", referenced from:
reflex::Input::get(char*, unsigned long) in libreflex.a(libreflex_a-matcher.o)
"std::__1::basic_istream<char, std::__1::char_traits>::seekg(long long, std::__1::ios_base::seekdir)", referenced from:
reflex::Input::istream_size() in libreflex.a(libreflex_a-input.o)
"std::__1::basic_istream<char, std::__1::char_traits>::tellg()", referenced from:
reflex::Input::istream_size() in libreflex.a(libreflex_a-input.o)
"std::__1::basic_ostream<char, std::__1::char_traits>::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits>&)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::__1::basic_ostream<char, std::__1::char_traits>::sentry::~sentry()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::__1::cerr", referenced from:
reflex::Pattern::error(int, unsigned long) const in libreflex.a(libreflex_a-pattern.o)
"std::__1::ctype::id", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::__1::locale::~locale()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::__1::ios_base::clear(unsigned int)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits>& std::__1::__put_character_sequence<char, std::__1::char_traits>(std::__1::basic_ostream<char, std::__1::char_traits>&, char const*, unsigned long) in libreflex.a(libreflex_a-pattern.o)
"std::bad_alloc::bad_alloc()", referenced from:
reflex::AbstractMatcher::grow(unsigned long) in libreflex.a(libreflex_a-matcher.o)
reflex::AbstractMatcher::reset(char const*) in libreflex.a(libreflex_a-matcher.o)
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
Any ideas on what I could do?
My code links properly on other platforms.
Beta Was this translation helpful? Give feedback.
All reactions