testdisk_documentation icon indicating copy to clipboard operation
testdisk_documentation copied to clipboard

specify CoreFoundation framework flag on Mac

Open mattcg opened this issue 1 year ago • 2 comments

Without this flag, testdisk won't compiled on Mac, with make producing the error Undefined symbols for architecture x86_64: "_CFRelease" [...].

mattcg avatar Mar 08 '24 20:03 mattcg

Which version of Mac OS X are you using (copy/paste "sw_vers" output) ?

I have no problem on my old VM

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H15

Another solution may be to modify the configure.ac script, something like

# tweak platform specific flags
case "$host" in
    *darwin*)
       LDFLAGS="${LDFLAGS} --framework CoreFoundation"
    ;;
esac

But it may break compilation on systems older than 10.15

cgsecurity avatar Mar 09 '24 09:03 cgsecurity

This is on Monterey (macOS 12).

One thing I also noticed is that LDFLAGS="-L/usr/local/lib -lintl" ./configure --disable-ntfs-3g --disable-nfconv is the only way ntfs-3g will configure, otherwise I get the following error (on both OS X 12 and 14):

libtool: link: gcc -g -O2 -Wall -o .libs/ntfsfix ntfsfix.o utils.o  ../libntfs-3g/.libs/libntfs-3g.dylib -lc
Undefined symbols for architecture x86_64:
  "_libintl_setlocale", referenced from:
      _utils_set_locale in utils.o
      _utils_set_locale in utils.o

mattcg avatar Mar 09 '24 14:03 mattcg