You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying the latest Git version and compiled all the C files using compiler defaults, on macOS the binary buffer interface fails with the following message:
cc -o main main.o libcork.a
Undefined symbols for architecture x86_64:
"_cork_buffer_append_copy", referenced from:
_cork_error_prefix_printf in libcork.a(error.o)
_cork_error_prefix_string in libcork.a(error.o)
_cork_error_prefix_vprintf in libcork.a(error.o)
ld: symbol(s) not found for architecture x86_64
I suspect the CORK_INLINE does something that the compiler dislike because in the libcork.a static library the symbols are not visible.
$ nm libcork.a | grep append_copy
U _cork_buffer_append_copy
U _cork_buffer_append_copy
I think that's also why most C people recommend to not use inline functions in headers. According to the code, CORK_INLINE is correctly set to inline rather than static in line 158 from attributes.h
The text was updated successfully, but these errors were encountered:
markand
changed the title
undefined reference to _cork_buffer_append_copy
undefined reference to _cork_buffer_append_copy on macOS
Jul 4, 2022
Hi,
Trying the latest Git version and compiled all the C files using compiler defaults, on macOS the binary buffer interface fails with the following message:
The code that generates the error is as simple:
I suspect the
CORK_INLINE
does something that the compiler dislike because in the libcork.a static library the symbols are not visible.I think that's also why most C people recommend to not use inline functions in headers. According to the code,
CORK_INLINE
is correctly set toinline
rather than static in line 158 from attributes.hThe text was updated successfully, but these errors were encountered: