BelledonneCommunications / bctoolbox

Linphone.org mirror for bctoolbox (git://git.linphone.org/bctoolbox.git)
http://linphone.org
GNU General Public License v3.0
25 stars 33 forks source link

Linker error when building with MacOS #22

Open RaphaelMaschinsen opened 1 year ago

RaphaelMaschinsen commented 1 year ago

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 commented 1 year ago

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.