0

Trying to compile code on OSX 10.15. which perfectly works on OSX 10.12 and got stuck. Quite familiar with general concept of linking and problem solving with undefined symbols as very well described here. Using command line tools only, libtool and clang++ are provided by Xcode. Seems to be a problem with my local OSX CLT chain. Tried reinstallation of full Xcode.

Compiling files with:

clang++ -g -Wall -arch x86_64 -o ./Permutation.o Permutation.cpp
clang++ -g -Wall -arch x86_64 -o ./MarchingCubes.o MarchingCubes.cpp

Then linking into shared library with:

libtool -install_name @rpath/libmodelling.dylib -dynamic  -L../../../release/lib/ -lstdc++ -lpthread  -lz -lm  Permutation.o MarchingCubes.o  -o ../../../release/lib//libmodelling.dylib

Resulting in

Undefined symbols for architecture x86_64:
  "__Unwind_Resume", referenced from:
      __ZN13MarchingCubesD2Ev in MarchingCubes.o

Tried several hints from similar questions on stackoverflow such as: Setting -mmacosx-version-min=10.9, changing -lstdc++ against -lc++, trying g++ face of clang++

libunwind.dylib providing the "undefined symbol" lives in /usr/lib/system on my system which should be found via the umbrella framework System which again the compiler should figure out by himself if correctly understood.

thankful for any suggestion

  • 1
    Is there a reason you need to call `libtool` directly? Using `clang++` will include the appropriate library automatically – Alan Birtles Mar 22 '20 at 21:19
  • You are right. This works. – user13106144 Mar 23 '20 at 11:37
  • Used libtool to simplify relocation of older libs in Mac App structure. Compilation with clang works fine. Think I have to rework my build structure now.But its somehow sad that the generic tool chain does not work reliably. – user13106144 Mar 23 '20 at 18:26

0 Answers0