I'm getting an error when I try to build a JNI Shared library
m082166@R5191920 $ gcc-9 -fopenmp -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin/" -o libjni.jnilib -shared c_src/My_Java.c
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, file was built for unsupported file format ( 0x2D 0x2D 0x2D 0x20 0x21 0x74 0x61 0x70 0x69 0x2D 0x74 0x62 0x64 0x2D 0x76 0x33 ) which is not the architecture being linked (x86_64): /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture x86_64:
"_cblas_dgemm", referenced from:
_Java_CRC_1Prediction_InferenceAlgoCancer_convergeMatrixMKL in ccszHe7p.o
"_free", referenced from:
_Java_CRC_1Prediction_InferenceAlgoCancer_convergeMatrixJNI in ccszHe7p.o
_Java_CRC_1Prediction_InferenceAlgoCancer_convergeMatrixMKL in ccszHe7p.o
"_malloc", referenced from:
_Java_CRC_1Prediction_InferenceAlgoCancer_convergeMatrixJNI in ccszHe7p.o
_Java_CRC_1Prediction_InferenceAlgoCancer_convergeMatrixMKL in ccszHe7p.o
ld: symbol(s) not found for architecture x86_64
The file looks perfectly valid to me:
--- !tapi-tbd-v3
archs: [ x86_64 ]
uuids: [ 'x86_64: E6C586CE-EEFA-3B4B-9316-AC4322AF0E75' ]
platform: zippered
install-name: /usr/lib/libSystem.B.dylib
current-version: 1252.250.1
objc-constraint: none
exports:
- archs: [ x86_64 ]
re-exports: [ /usr/lib/system/libcache.dylib, /usr/lib/system/libcommonCrypto.dylib,
/usr/lib/system/libcompiler_rt.dylib, /usr/lib/system/libcopyfile.dylib,
/usr/lib/system/libcorecrypto.dylib, /usr/lib/system/libdispatch.dylib,
/usr/lib/system/libdyld.dylib, /usr/lib/system/libkeymgr.dylib,
/usr/lib/system/liblaunch.dylib, /usr/lib/system/libmacho.dylib,
/usr/lib/system/libquarantine.dylib, /usr/lib/system/libremovefile.dylib,
/usr/lib/system/libsystem_asl.dylib, /usr/lib/system/libsystem_blocks.dylib,
/usr/lib/system/libsystem_c.dylib, /usr/lib/system/libsystem_configuration.dylib,
/usr/lib/system/libsystem_coreservices.dylib, /usr/lib/system/libsystem_darwin.dylib,
/usr/lib/system/libsystem_dnssd.dylib, /usr/lib/system/libsystem_info.dylib,
/usr/lib/system/libsystem_kernel.dylib, /usr/lib/system/libsystem_m.dylib,
/usr/lib/system/libsystem_malloc.dylib, /usr/lib/system/libsystem_networkextension.dylib,
/usr/lib/system/libsystem_notify.dylib, /usr/lib/system/libsystem_platform.dylib,
/usr/lib/system/libsystem_pthread.dylib, /usr/lib/system/libsystem_sandbox.dylib,
/usr/lib/system/libsystem_secinit.dylib, /usr/lib/system/libsystem_symptoms.dylib,
/usr/lib/system/libsystem_trace.dylib, /usr/lib/system/libunwind.dylib,
/usr/lib/system/libxpc.dylib ]
symbols: [ 'R8289209$_close', 'R8289209$_fork', 'R8289209$_fsync', 'R8289209$_getattrlist',
'R8289209$_getrlimit', 'R8289209$_getxattr', 'R8289209$_open',
'R8289209$_pthread_attr_destroy', 'R8289209$_pthread_attr_init',
'R8289209$_pthread_attr_setdetachstate', 'R8289209$_pthread_create',
'R8289209$_pthread_mutex_lock', 'R8289209$_pthread_mutex_unlock',
'R8289209$_pthread_self', 'R8289209$_ptrace', 'R8289209$_read',
'R8289209$_setattrlist', 'R8289209$_setrlimit', 'R8289209$_sigaction',
'R8289209$_stat', 'R8289209$_sysctl', 'R8289209$_time', 'R8289209$_unlink',
'R8289209$_write', ___crashreporter_info__, _libSystem_atfork_child,
_libSystem_atfork_parent, _libSystem_atfork_prepare, _mach_init_routine ]
...
Why won't it link?