Undefined symbols for architecture arm64 building nokogiri-xmlsec-instructure Ruby gem - ruby-on-rails

Recently I was trying to get a Ruby on Rails project running on macOS Ventura (Apple M1 Silicon) and was running into a problem with building the nokogiri-xmlsec-instructure gem.
The build error:
make "DESTDIR="
compiling init.c
compiling nokogiri_decrypt_with_key.c
compiling nokogiri_encrypt_with_key.c
compiling nokogiri_helpers_set_attribute_id.c
compiling nokogiri_init.c
compiling nokogiri_sign.c
compiling nokogiri_verify_with.c
compiling options.c
compiling shutdown.c
compiling util.c
linking shared-object nokogiri_ext_xmlsec.bundle
Undefined symbols for architecture arm64:
"_noko_xml_document_pin_node", referenced from:
_decrypt_with_key in nokogiri_decrypt_with_key.o
"_noko_xml_node_wrap", referenced from:
_get_id in nokogiri_helpers_set_attribute_id.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [nokogiri_ext_xmlsec.bundle] Error 1
make failed, exit code 2

The solution for this problem is:
Make sure you have installed brew install libxmlsec1 pkg-config
Run bundle config build.nokogiri-xmlsec-instructure --with-ldflags="-Wl,-undefined,dynamic_lookup" (Source: https://github.com/instructure/nokogiri-xmlsec-instructure/issues/15)
You should now be able to bundle install and build nokogiri-xmlsec-instructure

Related

Undefined symbols for architecture x86_64 when using Tesseract

I am using tesseract provided by google. After following this tutorial, i finally built finish my app. However, when i run it, i run into the problem of undefined symbols. This is the error
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_G8Tesseract", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do i fix this issue? I tried searching online but none of the solutions worked for me. I tried reinstalling the pods and updating it. Then i faced this error
clang: error: no such file or directory: '/Users/admin/Desktop/tst/Pods/Target Support Files/Pods-tst/Pods-tst-dummy.m'
clang: error: no input files
When i tried redoing the project i get his error
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_G8Tesseract", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Apparently i had to add the TesseractOCR.framework separately even after using cocoa pods and disable Bitcode. This prevented the errors.
I think you should update pod version:
sudo gem install cocoapods
After this run:
pod update --verbose
Since Tesseract requires libstdc++.6.0.9.dylib (or libstdc++.6.0.9.tbd if libstdc++.6.0.9.dylib is unavailable in your current Xcode version) and CoreImage.framework you’ll need to link both of these libraries in.
In the General tab, scroll down to Linked Frameworks and Libraries.
There should be only one file here: TesseractOCR.framework, which you just added. Click the + button underneath the list. Find both libstdc++.dylib (or libstdc++.6.0.9.tbd) and CoreImage.framework and add them to your project.

gstreamer ios undefined symbol _gst_plugin_liveadder_register

I have tried to compile the gstreamer ios tutorial #3. I have built the iOS SDK from sources that I have checked out from git, the master tree, and then when I have tried to compile for iOS 9.2. I got the below link error which I have no explanation for. All help is much appreciated.
Undefined symbols for architecture arm64:
"_gst_plugin_liveadder_register", referenced from:
_gst_ios_init in gst_ios_init.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Theos not compiling with Arm64

I am trying to package a Jailbreak Tweak using Theos on Windows 8.1 (64bit). If I do not specify Arm64 it compiles fine and works on my iPhone 5. However not my 6s. The console says a big error which I don't understand. Any help trying to get this tweak to compile with 64bit architecture would be great.
Makefile:
ARCHS = armv7 armv7s arm64
test_FRAMEWORKS = UIKit
include theos/makefiles/common.mk
TWEAK_NAME = Forton
Forton_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk
SUBPROJECTS += fortonprefs
include $(THEOS_MAKE_PATH)/aggregate.mk
Error Log:
$ make package
/home/AbbottL/forton/theos/makefiles/targets/Cygwin/iphone.mk:38: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak Forton...
Linking tweak Forton...
ld: warning: ignoring file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o, missing required architecture arm64 in file /home/AbbottL/forton/theos/sdks/iPhoneOS8.1.sdk/usr/lib/dylib1.o (2 slices)
ld: warning: ignoring file /home/AbbottL/forton/theos/lib/libsubstrate.dylib, file was built for armv7 which is not the architecture being linked (arm64): /home/AbbottL/forton/theos/lib/libsubstrate.dylib
Undefined symbols for architecture arm64:
"_MSHookMessageEx", referenced from:
_logosLocalInit() in Tweak.xm.91812798.o
ld: symbol(s) not found for architecture arm64
armv7-apple-darwin11-clang: error: linker command failed with exit code 1 (use -v to see invocation)
/home/AbbottL/forton/theos/makefiles/instance/library.mk:27: recipe for target 'obj/Forton.dylib.1b5b9d6a.unsigned' failed
make[2]: *** [obj/Forton.dylib.1b5b9d6a.unsigned] Error 1
/home/AbbottL/forton/theos/makefiles/instance/library.mk:19: recipe for target 'internal-library-all_' failed
make[1]: *** [internal-library-all_] Error 2
/home/AbbottL/forton/theos/makefiles/master/rules.mk:54: recipe for target 'Forton.all.tweak.variables' failed
make: *** [Forton.all.tweak.variables] Error 2
Using ios 8.1 SDK
Fixed by swapping libsustrate file to a later version.

Getting error while Installing GMP 6.1.0 in iOS9.2 Xcode7.2

I have tried to install GMP Library Version 6.1.0 for iOS9.
I need to compile GMP in iOS for a math project. My configuration command was like this.
./configure CC=clang CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E" CPPFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/ -fembed-bitcode -miphoneos-version-min=7.0 -arch armv7 -target arm-apple-darwin" --host=aarch64-apple-darwin --disable-assembly --enable-static --disable-shared --disable-thread-safe --enable-cxx
Found this configure option in :This link.
Here is my environment details:
Mac OSX 10.11.2; Xcode7.2; iOS SDK 9.2
During "configure" state it shows one warning
configure: WARNING: unrecognized options: --disable-thread-safe
But it configures without any error.
Configure summary:
configure: summary of build options:
Version: GNU MP 6.1.0
Host type: aarch64-apple-darwin
ABI: standard
Install prefix: /usr/local
Compiler: clang
Static libraries: yes
Shared libraries: no
After that I run make command.
Then make check.
While running make check command it gives the following error.
or, in text form:
/bin/sh ../libtool --tag=CC --mode=link clang -mfpu=neon -O2 -pedantic -DNO_ASM -o t-bswap t-bswap.o libtests.la ../libgmp.la
libtool: link: clang -mfpu=neon -O2 -pedantic -DNO_ASM -o t-bswap t-bswap.o ./.libs/libtests.a [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a ../.libs/libgmp.a
ld: warning: ld: warning: ignoring file ./.libs/libtests.a, file was built for archive which is not the architecture being linked (x86_64): ./.libs/libtests.aignoring file t-bswap.o, file was built for armv7 which is not the architecture being linked (x86_64): t-bswap.o
ld: warning: ignoring file [redacted]/Documents/gmp-6.1.0/.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): /Users/[redacted]/Documents/gmp-6.1.0/.libs/libgmp.a
ld: warning: ignoring file ../.libs/libgmp.a, file was built for archive which is not the architecture being linked (x86_64): ../.libs/libgmp.a
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [t-bswap] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check-recursive] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2
I am stuck here. Your help is highly appreciated.
[EDITED]

GraphicsMagick, Undefined symbols for architecture x86_64

I am trying to install GraphicsMagick in Xcode4, I am getting this error when i execute command 'make'.
/usr/bin/ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-module.o) has no symbols
/usr/bin/ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-PreRvIcccm.o) has no symbols
libtool: link: ranlib magick/.libs/libGraphicsMagick.a
ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-module.o) has no symbols
ranlib: file: magick/.libs/libGraphicsMagick.a(magick_libGraphicsMagick_la-PreRvIcccm.o) has no symbols
Undefined symbols for architecture x86_64:
"___builtin_object_size", referenced from:
_BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o)
_XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
_YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [utilities/gm] Error 1
make: *** [install] Error 2
GraphicsMagick won't compile on OS X 10.7 (Lion) or 10.8 (Mountain Lion) with the default LLVM GCC/G++ compilers. The workaround is to use the Clang compiler instead:
./configure CC=clang [...other config options...]
It is also a good idea to run the unit tests with make check after compilation just to be on the safe side.
This trick worked for me, hope it helps.
You can find a solution here.
http://sourceforge.net/projects/graphicsmagick/forums/forum/250738/topic/5221775

Resources