Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error when building with MacOS #22

Open
RaphaelMaschinsen opened this issue Mar 9, 2023 · 1 comment
Open

Linker error when building with MacOS #22

RaphaelMaschinsen opened this issue Mar 9, 2023 · 1 comment

Comments

@RaphaelMaschinsen
Copy link

I'm building on MacOS 11.7 (AppleClang 13.0.0.13000029):

At first I run cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_TESTS=NO -DENABLE_TESTS_COMPONENT=NO -DENABLE_STRICT=NO the build then fails when linking:

Undefined symbols for architecture x86_64:
  "_libiconv", referenced from:
      convert_from_to(char const*, char const*, char const*) in charconv.cc.o
  "_libiconv_close", referenced from:
      convert_from_to(char const*, char const*, char const*) in charconv.cc.o
  "_libiconv_open", referenced from:
      convert_from_to(char const*, char const*, char const*) in charconv.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/bctoolbox.framework/Versions/A/bctoolbox] Error 1
make[1]: *** [src/CMakeFiles/bctoolbox.dir/all] Error 2
make: *** [all] Error 2

Following the exact same steps I build successfully on ArchLinux (GNU 12.2.1)

@RaphaelMaschinsen
Copy link
Author

An important detail:
Building and linking the static library worked. The error occurs when building the shared library.

I installed libiconv with brew install libiconv and libiconv.dylib is located in the /usr/local/Cellar/libiconv/1.17/lib folder next to libiconv.a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant