Any iOS Device build errors after WebRTC's XCFramework update - ios

I'm getting errors after I have updated to XCFramework of WebRTC. Here's manual instruction of it: https://swiftpackageregistry.com/alexpiezo/WebRTC
...missing required architecture armv7...
I don't need for Mac, so my steps like that:
gn gen ./out/ios_arm64 --args='target_os="ios" target_cpu="arm64" is_component_build=false is_debug=false ios_deployment_target="10.0" rtc_libvpx_build_vp9=true use_goma=false ios_enable_code_signing=false enable_stripping=true enable_ios_bitcode=false'
gn gen out/ios_x64 --args='target_os="ios" target_cpu="x64" is_component_build=false is_debug=false ios_deployment_target="10.0" rtc_libvpx_build_vp9=true use_goma=false ios_enable_code_signing=false enable_stripping=true enable_ios_bitcode=false'
ninja -C out/ios_arm64 sdk:framework_objc
ninja -C out/ios_x64 sdk:framework_objc
xcodebuild -create-xcframework \
-framework ./out/ios_arm64/WebRTC.framework \
-framework ./out/ios_x64/WebRTC.framework \
-output ./out/WebRTC.xcframework
It's working on iOS Simulators and real devices but Any iOS Device (arm64, armv7) does not work.
Undefined symbol: _OBJC_CLASS_$_RTCMediaConstraints
Undefined symbol: _kRTCMediaStreamTrackKindVideo
Undefined symbol: _OBJC_CLASS_$_RTCAudioSessionConfiguration
Undefined symbol: _OBJC_CLASS_$_RTCAudioSession
Undefined symbol: _OBJC_CLASS_$_RTCIceCandidate
Undefined symbol: _OBJC_CLASS_$_RTCIceServer
Undefined symbol: _OBJC_CLASS_$_RTCConfiguration
Undefined symbol: _OBJC_CLASS_$_RTCCallbackLogger
Undefined symbol: _OBJC_CLASS_$_RTCPeerConnectionFactory
Undefined symbol: _OBJC_CLASS_$_RTCDispatcher
Undefined symbol: _OBJC_CLASS_$_RTCDefaultVideoDecoderFactory
Undefined symbol: _OBJC_CLASS_$_RTCSessionDescription
Undefined symbol: _RTCSetMinDebugLogLevel
Undefined symbol: _OBJC_CLASS_$_RTCRtpTransceiverInit
Undefined symbol: _OBJC_CLASS_$_RTCCameraVideoCapturer
Undefined symbol: _OBJC_METACLASS_$_RTCEAGLVideoView
Undefined symbol: _OBJC_CLASS_$_RTCDefaultVideoEncoderFactory
Undefined symbol: _OBJC_CLASS_$_RTCEAGLVideoView
Is there any advice what should I do to overcome it?

Use the following as an argument to gn gen:
--args='target_os="ios" ios_enable_code_signing=false use_xcode_clang=true is_component_build=false rtc_include_tests=false is_debug=false target_cpu="arm64" ios_deployment_target="10.0" rtc_libvpx_build_vp9=false enable_ios_bitcode=false use_goma=false rtc_enable_symbol_export=true enable_dsyms=true enable_stripping=true'
The key here is the rtc_enable_symbol_export=true argument.

Related

Linking LLVM-16 with Clang++ 16 when Compiling the Kaleidoscope examples with C++14 on Ubuntu 20.04 WSL2 Windows 10

I've tried with many versions of llvm, installed, uninstalled, the original tutorial code and the one with folders and a make file from: https://github.com/ghaiklor/llvm-kaleidoscope
(with adjustments).
The latest iteration and the best solution so far is with the original code and latest llvm:
https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.html
clang++ -g -O3 3.cpp -I /lib/llvm-16/include/ `llvm-config -std=c++14 --cxxflags --ldflags --system-libs --libs all --version` -v -o 3.exe
It seems it compiles, but the linker complains for "undefined references" to probably all llvm files.
llvm-config reports a location of the libraries, in /usr/lib/... as shown below; I found the libs also in root /lib/llvm-16/lib if that could cause some conflict, but I doubt that.
clang++ --version
Ubuntu clang version 16.0.0 (++20230109052936+64f06dda87cf-1~exp1~20230109173029.503)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
llvm-config --libdir
/usr/lib/llvm-16/lib
ls /usr/lib/llvm-16/lib
LLVMPolly.so libLLVMDlltoolDriver.a libLLVMPowerPCCodeGen.a
LLVMgold.so libLLVMExecutionEngine.a libLLVMPowerPCDesc.a
clang libLLVMExegesis.a libLLVMPowerPCDisassembler.a
cmake libLLVMExegesisAArch64.a libLLVMPowerPCInfo.a
libLLVM-16.0.0.so libLLVMExegesisMips.a libLLVMProfileData.a
libLLVM-16.0.0.so.1 libLLVMExegesisPowerPC.a libLLVMRISCVAsmParser.a
libLLVM-16.so libLLVMExegesisX86.a libLLVMRISCVCodeGen.a
libLLVM-16.so.1 libLLVMExtensions.a libLLVMRISCVDesc.a
libLLVM.so libLLVMFileCheck.a libLLVMRISCVDisassembler.a
libLLVMAArch64AsmParser.a libLLVMFrontendHLSL.a libLLVMRISCVInfo.a
libLLVMAArch64CodeGen.a libLLVMFrontendOpenACC.a libLLVMRISCVTargetMCA.a
libLLVMAArch64Desc.a libLLVMFrontendOpenMP.a libLLVMRemarks.a
libLLVMAArch64Disassembler.a libLLVMFuzzMutate.a libLLVMRuntimeDyld.a
libLLVMAArch64Info.a libLLVMFuzzerCLI.a libLLVMScalarOpts.a
libLLVMAArch64Utils.a libLLVMGlobalISel.a libLLVMSelectionDAG.a
libLLVMAMDGPUAsmParser.a libLLVMHexagonAsmParser.a libLLVMSparcAsmParser.a
libLLVMAMDGPUCodeGen.a libLLVMHexagonCodeGen.a libLLVMSparcCodeGen.a
libLLVMAMDGPUDesc.a libLLVMHexagonDesc.a libLLVMSparcDesc.a
libLLVMAMDGPUDisassembler.a libLLVMHexagonDisassembler.a libLLVMSparcDisassembler.a
libLLVMAMDGPUInfo.a libLLVMHexagonInfo.a libLLVMSparcInfo.a
libLLVMAMDGPUTargetMCA.a libLLVMIRPrinter.a libLLVMSupport.a
libLLVMAMDGPUUtils.a libLLVMIRReader.a libLLVMSymbolize.a
libLLVMARMAsmParser.a libLLVMInstCombine.a libLLVMSystemZAsmParser.a
libLLVMARMCodeGen.a libLLVMInstrumentation.a libLLVMSystemZCodeGen.a
libLLVMARMDesc.a libLLVMInterfaceStub.a libLLVMSystemZDesc.a
libLLVMARMDisassembler.a libLLVMInterpreter.a libLLVMSystemZDisassembler.a
libLLVMARMInfo.a libLLVMJITLink.a libLLVMSystemZInfo.a
libLLVMARMUtils.a libLLVMLTO.a libLLVMTableGen.a
libLLVMAVRAsmParser.a libLLVMLanaiAsmParser.a libLLVMTableGenGlobalISel.a
libLLVMAVRCodeGen.a libLLVMLanaiCodeGen.a libLLVMTarget.a
libLLVMAVRDesc.a libLLVMLanaiDesc.a libLLVMTargetParser.a
libLLVMAVRDisassembler.a libLLVMLanaiDisassembler.a libLLVMTextAPI.a
libLLVMAVRInfo.a libLLVMLanaiInfo.a libLLVMTransformUtils.a
libLLVMAggressiveInstCombine.a libLLVMLibDriver.a libLLVMVEAsmParser.a
libLLVMAnalysis.a libLLVMLineEditor.a libLLVMVECodeGen.a
libLLVMAsmParser.a libLLVMLinker.a libLLVMVEDesc.a
libLLVMAsmPrinter.a libLLVMM68kAsmParser.a libLLVMVEDisassembler.a
libLLVMBOLTCore.a libLLVMM68kCodeGen.a libLLVMVEInfo.a
libLLVMBOLTPasses.a libLLVMM68kDesc.a libLLVMVectorize.a
libLLVMBOLTProfile.a libLLVMM68kDisassembler.a libLLVMWebAssemblyAsmParser.a
libLLVMBOLTRewrite.a libLLVMM68kInfo.a libLLVMWebAssemblyCodeGen.a
libLLVMBOLTRuntimeLibs.a libLLVMMC.a libLLVMWebAssemblyDesc.a
libLLVMBOLTTargetAArch64.a libLLVMMCA.a libLLVMWebAssemblyDisassembler.a
libLLVMBOLTTargetX86.a libLLVMMCDisassembler.a libLLVMWebAssemblyInfo.a
libLLVMBOLTUtils.a libLLVMMCJIT.a libLLVMWebAssemblyUtils.a
libLLVMBPFAsmParser.a libLLVMMCParser.a libLLVMWindowsDriver.a
libLLVMBPFCodeGen.a libLLVMMIRParser.a libLLVMWindowsManifest.a
libLLVMBPFDesc.a libLLVMMSP430AsmParser.a libLLVMX86AsmParser.a
libLLVMBPFDisassembler.a libLLVMMSP430CodeGen.a libLLVMX86CodeGen.a
libLLVMBPFInfo.a libLLVMMSP430Desc.a libLLVMX86Desc.a
libLLVMBinaryFormat.a libLLVMMSP430Disassembler.a libLLVMX86Disassembler.a
libLLVMBitReader.a libLLVMMSP430Info.a libLLVMX86Info.a
libLLVMBitWriter.a libLLVMMipsAsmParser.a libLLVMX86TargetMCA.a
libLLVMBitstreamReader.a libLLVMMipsCodeGen.a libLLVMXCoreCodeGen.a
libLLVMCFGuard.a libLLVMMipsDesc.a libLLVMXCoreDesc.a
libLLVMCFIVerify.a libLLVMMipsDisassembler.a libLLVMXCoreDisassembler.a
libLLVMCodeGen.a libLLVMMipsInfo.a libLLVMXCoreInfo.a
libLLVMCore.a libLLVMNVPTXCodeGen.a libLLVMXRay.a
libLLVMCoroutines.a libLLVMNVPTXDesc.a libLLVMipo.a
libLLVMCoverage.a libLLVMNVPTXInfo.a libLTO.so
libLLVMDWARFLinker.a libLLVMObjCARCOpts.a libLTO.so.16
libLLVMDWP.a libLLVMObjCopy.a libPolly.a
libLLVMDebugInfoCodeView.a libLLVMObject.a libPollyISL.a
libLLVMDebugInfoDWARF.a libLLVMObjectYAML.a libRemarks.so
libLLVMDebugInfoGSYM.a libLLVMOption.a libRemarks.so.16
libLLVMDebugInfoLogicalView.a libLLVMOrcJIT.a libclang-16.so.1
libLLVMDebugInfoMSF.a libLLVMOrcShared.a libclang-cpp.so.16
libLLVMDebugInfoPDB.a libLLVMOrcTargetProcess.a libclang.so.1
libLLVMDebuginfod.a libLLVMPasses.a liblldb.so.1
libLLVMDemangle.a libLLVMPerfJITEvents.a liblldbIntelFeatures.so.16
libLLVMDiff.a libLLVMPowerPCAsmParser.a
Get various configuration information needed to compile programs which use
LLVM. Typically called from 'configure' scripts. Examples:
llvm-config --cxxflags
llvm-config --ldflags
llvm-config --libs engine bcreader scalaropts
Options:
--assertion-mode Print assertion mode of LLVM tree (ON or OFF).
--bindir Directory containing LLVM executables.
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).
--build-system Print the build system used to build LLVM (e.g. `cmake` or `gn`).
--cflags C compiler flags for files that include LLVM headers.
--cmakedir Directory containing LLVM CMake modules.
--components List of all possible components.
--cppflags C preprocessor flags for files that include LLVM headers.
--cxxflags C++ compiler flags for files that include LLVM headers.
--has-rtti Print whether or not LLVM was built with rtti (YES or NO).
--help Print a summary of llvm-config arguments.
--host-target Target triple used to configure LLVM.
--ignore-libllvm Ignore libLLVM and link component libraries instead.
--includedir Directory containing LLVM headers.
--ldflags Print Linker flags.
--libdir Directory containing LLVM libraries.
--libfiles Fully qualified library filenames for makefile depends.
--libnames Bare library names for in-tree builds.
--libs Libraries needed to link against LLVM components.
--link-shared Link the components as shared libraries.
--link-static Link the component libraries statically.
--obj-root Print the object root used to build LLVM.
--prefix Print the installation prefix.
--shared-mode Print how the provided components can be collectively linked (`shared` or `static`).
--system-libs System Libraries needed to link against LLVM components.
--targets-built List of all targets currently built.
--version Print LLVM version.
Typical components:
all All LLVM libraries (default).
engine Either a native JIT or a bitcode interpreter.
Ubuntu clang version 16.0.0 (++20230109052936+64f06dda87cf-1~exp1~20230109173029.503)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;#m64
Selected multilib: .;#m64
"/usr/lib/llvm-16/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name 3.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -v -fcoverage-compilation-dir=/mnt/z/c -resource-dir /usr/lib/llvm-16/lib/clang/16 -I /lib/llvm-16/include/ -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /usr/lib/llvm-16/lib/clang/16/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -fdeprecated-macro -fdebug-compilation-dir=/mnt/z/c -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/3-9b8468.o -x c++ 3.cpp
clang -cc1 version 16.0.0 based upon LLVM 16.0.0 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/lib/llvm-16/include
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9
/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward
/usr/lib/llvm-16/lib/clang/16/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
"/usr/bin/ld" -pie -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o 82-14 /lib/x86_64-linux-gnu/Scrt1.o /lib/x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/9 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../lib64 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -L/lib -L/usr/lib /tmp/3-9b8468.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/x86_64-linux-gnu/9/crtendS.o /lib/x86_64-linux-gnu/crtn.o
/usr/bin/ld: /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
/tmp/3-9b8468.o: in function `main':
3.cpp:(.text+0x26f): undefined reference to `llvm::LLVMContext::LLVMContext()'
/usr/bin/ld: 3.cpp:(.text+0x28a): undefined reference to `llvm::LLVMContext::~LLVMContext()'
/usr/bin/ld: 3.cpp:(.text+0x2c0): undefined reference to `llvm::Module::Module(llvm::StringRef, llvm::LLVMContext&)'/usr/bin/ld: 3.cpp:(.text+0x2db): undefined reference to `llvm::Module::~Module()'
/usr/bin/ld: 3.cpp:(.text+0x34b): undefined reference to `vtable for llvm::ConstantFolder'
/usr/bin/ld: 3.cpp:(.text+0x35a): undefined reference to `vtable for llvm::IRBuilderDefaultInserter'
/usr/bin/ld: 3.cpp:(.text+0x384): undefined reference to `llvm::IRBuilderDefaultInserter::~IRBuilderDefaultInserter()'
/usr/bin/ld: 3.cpp:(.text+0x38d): undefined reference to `llvm::IRBuilderFolder::~IRBuilderFolder()'
/usr/bin/ld: 3.cpp:(.text+0x5b7): undefined reference to `llvm::errs()'
/usr/bin/ld: 3.cpp:(.text+0x5c9): undefined reference to `llvm::Function::print(llvm::raw_ostream&, llvm::AssemblyAnnotationWriter*, bool, bool) const'
/usr/bin/ld: 3.cpp:(.text+0x5df): undefined reference to `llvm::Function::eraseFromParent()'
/usr/bin/ld: 3.cpp:(.text+0x61d): undefined reference to `llvm::errs()'
/usr/bin/ld: 3.cpp:(.text+0x62f): undefined reference to `llvm::Function::print(llvm::raw_ostream&, llvm::AssemblyAnnotationWriter*, bool, bool) const'
/usr/bin/ld: 3.cpp:(.text+0x705): undefined reference to `llvm::errs()'
/usr/bin/ld: 3.cpp:(.text+0x717): undefined reference to `llvm::Function::print(llvm::raw_ostream&, llvm::AssemblyAnnotationWriter*, bool, bool) const'
/usr/bin/ld: 3.cpp:(.text+0x760): undefined reference to `llvm::errs()'
/usr/bin/ld: 3.cpp:(.text+0x772): undefined reference to `llvm::Module::print(llvm::raw_ostream&, llvm::AssemblyAnnotationWriter*, bool, bool) const'
/usr/bin/ld: /tmp/3-9b8468.o: in function `(anonymous namespace)::FunctionAST::codegen()':
3.cpp:(.text+0xb94): undefined reference to `llvm::Module::getFunction(llvm::StringRef) const'
/usr/bin/ld: 3.cpp:(.text+0xbee): undefined reference to `llvm::BasicBlock::BasicBlock(llvm::LLVMContext&, llvm::Twine const&, llvm::Function*, llvm::BasicBlock*)'
/usr/bin/ld: 3.cpp:(.text+0xc5e): undefined reference to `llvm::Function::BuildLazyArguments() const'
/usr/bin/ld: 3.cpp:(.text+0xc78): undefined reference to `llvm::Function::BuildLazyArguments() const'
/usr/bin/ld: 3.cpp:(.text+0xcc1): undefined reference to `llvm::Value::getName() const'
/usr/bin/ld: 3.cpp:(.text+0xd89): undefined reference to `llvm::verifyFunction(llvm::Function const&, llvm::raw_ostream*)'
/usr/bin/ld: 3.cpp:(.text+0xd95): undefined reference to `llvm::Function::eraseFromParent()'
/usr/bin/ld: /tmp/3-9b8468.o: in function `(anonymous namespace)::CallExprAST::codegen()':
3.cpp:(.text+0x1e41): undefined reference to `llvm::Module::getFunction(llvm::StringRef) const'
/usr/bin/ld: /tmp/3-9b8468.o: in function `(anonymous namespace)::NumberExprAST::codegen()':
3.cpp:(.text+0x2153): undefined reference to `llvm::detail::IEEEFloat::IEEEFloat(double)'
/usr/bin/ld: 3.cpp:(.text+0x2158): undefined reference to `llvm::APFloatBase::IEEEdouble()'
/usr/bin/ld: 3.cpp:(.text+0x2166): undefined reference to `llvm::APFloat::Storage::Storage(llvm::detail::IEEEFloat, llvm::fltSemantics const&)'
/usr/bin/ld: 3.cpp:(.text+0x2170): undefined reference to `llvm::detail::IEEEFloat::~IEEEFloat()'
/usr/bin/ld: 3.cpp:(.text+0x217d): undefined reference to `llvm::ConstantFP::get(llvm::LLVMContext&, llvm::APFloat const&)'
/usr/bin/ld: 3.cpp:(.text+0x218a): undefined reference to `llvm::APFloatBase::PPCDoubleDouble()'
/usr/bin/ld: 3.cpp:(.text+0x2197): undefined reference to `llvm::detail::IEEEFloat::~IEEEFloat()'
/usr/bin/ld: 3.cpp:(.text+0x21dc): undefined reference to `llvm::detail::IEEEFloat::~IEEEFloat()'
/usr/bin/ld: /tmp/3-9b8468.o: in function `(anonymous namespace)::BinaryExprAST::codegen()':
3.cpp:(.text+0x2393): undefined reference to `llvm::IRBuilderBase::CreateFCmpHelper(llvm::CmpInst::Predicate, llvm::Value*, llvm::Value*, llvm::Twine const&, llvm::MDNode*, bool)'
/usr/bin/ld: 3.cpp:(.text+0x23ad): undefined reference to `llvm::Type::getDoubleTy(llvm::LLVMContext&)'
/usr/bin/ld: 3.cpp:(.text+0x23ec): undefined reference to `llvm::IRBuilderBase::CreateConstrainedFPCast(unsigned int, llvm::Value*, llvm::Type*, llvm::Instruction*, llvm::Twine const&, llvm::MDNode*, std::optional<llvm::RoundingMode>, std::optional<llvm::fp::ExceptionBehavior>)'
/usr/bin/ld: /tmp/3-9b8468.o: in function `(anonymous namespace)::PrototypeAST::codegen()':
3.cpp:(.text+0x2467): undefined reference to `llvm::Type::getDoubleTy(llvm::LLVMContext&)'
/usr/bin/ld: 3.cpp:(.text+0x2504): undefined reference to `llvm::Type::getDoubleTy(llvm::LLVMContext&)'
/usr/bin/ld: 3.cpp:(.text+0x251b): undefined reference to `llvm::FunctionType::get(llvm::Type*, llvm::ArrayRef<llvm::Type*>, bool)'
/usr/bin/ld: 3.cpp:(.text+0x253b): undefined reference to `llvm::User::operator new(unsigned long)'
/usr/bin/ld: 3.cpp:(.text+0x2558): undefined reference to `llvm::Function::Function(llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, unsigned int, llvm::Twine const&, llvm::Module*)'
/usr/bin/ld: 3.cpp:(.text+0x2570): undefined reference to `llvm::Function::BuildLazyArguments() const'
/usr/bin/ld: 3.cpp:(.text+0x2588): undefined reference to `llvm::Function::BuildLazyArguments() const'
/usr/bin/ld: 3.cpp:(.text+0x25ce): undefined reference to `llvm::Value::setName(llvm::Twine const&)'
/usr/bin/ld: 3.cpp:(.text+0x2614): undefined reference to `llvm::User::operator delete(void*)'
/usr/bin/ld: /tmp/3-9b8468.o: in function `std::unique_ptr<llvm::LLVMContext, std::default_delete<llvm::LLVMContext> >::~unique_ptr()':
3.cpp:(.text._ZNSt10unique_ptrIN4llvm11LLVMContextESt14default_deleteIS1_EED2Ev[_ZNSt10unique_ptrIN4llvm11LLVMContextESt14default_deleteIS1_EED2Ev]+0x13): undefined reference to `llvm::LLVMContext::~LLVMContext()'
/usr/bin/ld: /tmp/3-9b8468.o: in function `std::unique_ptr<llvm::Module, std::default_delete<llvm::Module> >::~unique_ptr()':
3.cpp:(.text._ZNSt10unique_ptrIN4llvm6ModuleESt14default_deleteIS1_EED2Ev[_ZNSt10unique_ptrIN4llvm6ModuleESt14default_deleteIS1_EED2Ev]+0x13): undefined reference to `llvm::Module::~Module()'
/usr/bin/ld: /tmp/3-9b8468.o: in function `std::unique_ptr<llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>, std::default_delete<llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter> > >::~unique_ptr()':
(...) etc.
/usr/bin/ld: 3.cpp:(.text._ZN4llvm13IRBuilderBase9CreateRetEPNS_5ValueE[_ZN4llvm13IRBuilderBase9CreateRetEPNS_5ValueE]+0x7b): undefined reference to `llvm::Instruction::setMetadata(unsigned int, llvm::MDNode*)'
/usr/bin/ld: 3.cpp:(.text._ZN4llvm13IRBuilderBase9CreateRetEPNS_5ValueE[_ZN4llvm13IRBuilderBase9CreateRetEPNS_5ValueE]+0x9e): undefined reference to `llvm::User::operator delete(void*)'
/usr/bin/ld: /tmp/3-9b8468.o:(.data+0x0): undefined reference to `llvm::DisableABIBreakingChecks'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas? Thanks.
The solution was to start a fresh WSL instance... :) In the new one it started compiling.
One more note, for the parts of the tutorial having an "extern printd()" such as part 6 etc., if using clang++ as suggested, add "-Wl,--export-dynamic" to the clang++ part of the command line, otherwise the extern printd() function couldn't be resolved.
A specific call for my case (however I don't use the folder structure from the example which is ../include/KaleidoscopeJIT.h from the repository, I copied only this file to the current directory):
clang++ -g 6.cpp -I KaleidoscopeJIT.h -Wl,--export-dynamic $(llvm-co
nfig --cxxflags --ldflags --system-libs --libs core orcjit native ) -O3 -o 62
./62
ready> extern printd(x);
ready> Read extern: declare double #printd(double)
ready> printd(1)
ready> ;
1.000000
Evaluated to 0.000000

React Native zoom sdk ios error " Undefined symbol: _OBJC_CLASS_$_ZoomVideoSDK"

In my project add package for video call
#zoom/react-native-videosdk
I have followed their documentation and installed SDK for ios. but when running the build from Xcode gets the following error.
enter image description here
Errors:
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKSessionContext
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKVideoOptions
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKAudioOptions
Undefined symbol: OBJC_CLASS$_ZoomVideoSDK
Undefined symbol: OBJC_CLASS$_ZoomVideoSDKInitParams
Add framework in Link binary with libraries
Add in embed frameworks
in build setting setup Other Linker Flags with -all_load
pod delete reinstall, rebuild

ld: framework not found FacebookAdapter

after install this library in a react-native project I have got this error.
ld: framework not found FacebookAdapter
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have these lines in pod file
pod 'Google-Mobile-Ads-SDK'
pod 'GoogleMobileAdsMediationFacebook'
but still have issues. I have downgrade the
pod 'Google-Mobile-Ads-SDK'
pod 'GoogleMobileAdsMediationFacebook'
to lower version and tried multiple lower versions then I got these errors
Showing Recent Messages
Undefined symbol: OBJC_CLASS$_GADAdLoader
Showing Recent Messages
Undefined symbol: OBJC_CLASS$_GADMultipleAdsAdLoaderOptions
Showing Recent Messages
Undefined symbol: OBJC_METACLASS$_GADNativeAdView
Showing Recent Messages
Undefined symbol: OBJC_CLASS$_GADCustomEventExtras
Showing Recent Messages
Undefined symbol: _GADSimulatorID
Showing Recent Messages
Undefined symbol: OBJC_CLASS$_GADCustomEventExtras
Showing Recent Messages
Undefined symbol: OBJC_CLASS$_GADNativeAdMediaAdLoaderOptions
Showing Recent Messages
Undefined symbol: OBJC_CLASS$_GADNativeAdViewAdOptions

Undefined symbol: nominal type descriptor for Swift.UInt8

I am trying to run react native app in a Mac Mini with Apple M1 chipset.The project run well on intel based system but not running on M1. When I build I got following errors.
Undefined symbol: nominal type descriptor for Swift.UInt8
Undefined symbol: nominal type descriptor for Swift._ContiguousArrayStorage
Undefined symbol: _swift_deletedMethodError
Undefined symbol: __swift_FORCE_LOAD_$_swiftsimd
Undefined symbol: _swift_deallocObject
Undefined symbol: _swift_getObjCClassMetadata
Undefined symbol: __swift_FORCE_LOAD_$_swiftAVFoundation
Undefined symbol: Swift.String.count.getter : Swift.Int
Undefined symbol: (extension in Foundation):Swift.StringProtocol.cString(using: (extension in Foundation):Swift.String.Encoding) -> [Swift.Int8]?
Undefined symbol: Foundation.Data._Representation.replaceSubrange(_: Swift.Range<Swift.Int>, with: Swift.UnsafeRawPointer?, count: Swift.Int) -> ()
Undefined symbol: type metadata accessor for Foundation.__DataStorage
Undefined symbol: type metadata accessor for Foundation.Data.RangeReference
Undefined symbol: Swift.Hasher.init(_seed: Swift.Int) -> Swift.Hasher
Undefined symbol: Swift.String.hash(into: inout Swift.Hasher) -> ()
Undefined symbol: Swift.Hasher._finalize() -> Swift.Int
Undefined symbol: Foundation._convertNSErrorToError(__C.NSError?) -> Swift.Error
Undefined symbol: static (extension in ObjectiveC):__C.NSObject.== infix(__C.NSObject, __C.NSObject) -> Swift.Bool
Undefined symbol: static (extension in Foundation):Swift.String._unconditionallyBridgeFromObjectiveC(__C.NSString?) -> Swift.String
Undefined symbol: _swift_beginAccess
Undefined symbol: static (extension in Foundation):Swift.Dictionary._unconditionallyBridgeFromObjectiveC(__C.NSDictionary?) -> [A : B]
Undefined symbol: _swift_getTypeByMangledNameInContextInMetadataState
Undefined symbol: __swiftEmptyDictionarySingleton
Undefined symbol: _swift_bridgeObjectRetain
Undefined symbol: Swift._StringGuts.grow(Swift.Int) -> ()
Undefined symbol: nominal type descriptor for Swift.AnyHashable
Undefined symbol: static Swift._DictionaryStorage.allocate(capacity: Swift.Int) -> Swift._DictionaryStorage<A, B>
Undefined symbol: Swift.String.append(Swift.String) -> ()
Undefined symbol: protocol witness table for Swift.AnyHashable : Swift.Hashable in Swift
Undefined symbol: _swift_initStackObject
Undefined symbol: _swift_getWitnessTable
Undefined symbol: (extension in Foundation):Swift.Dictionary._bridgeToObjectiveC() -> __C.NSDictionary
Undefined symbol: protocol witness table for Swift.String : Swift.Hashable in Swift
Undefined symbol: __swift_FORCE_LOAD_$_swiftDispatch
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreImage
Undefined symbol: __swiftEmptyArrayStorage
Undefined symbol: Swift.KEY_TYPE_OF_DICTIONARY_VIOLATES_HASHABLE_REQUIREMENTS(Any.Type) -> Swift.Never
Undefined symbol: Foundation.NSLog(Swift.String, Swift.CVarArg...) -> ()
Undefined symbol: _swift_bridgeObjectRetain_n
Undefined symbol: (extension in Foundation):Swift.String._bridgeToObjectiveC() -> __C.NSString
Undefined symbol: _swift_bridgeObjectRelease
Undefined symbol: Foundation.Data._bridgeToObjectiveC() -> __C.NSData
Undefined symbol: _swift_allocObject
Undefined symbol: static (extension in Foundation):Swift.String.Encoding.utf8.getter : (extension in Foundation):Swift.String.Encoding
Undefined symbol: Swift._HashTable.previousHole(before: Swift._HashTable.Bucket) -> Swift._HashTable.Bucket
Undefined symbol: _swift_initStaticObject
Undefined symbol: protocol conformance descriptor for Swift.String : Swift.StringProtocol in Swift
Undefined symbol: associated type descriptor for Swift.ExpressibleByIntegerLiteral.IntegerLiteralType
Undefined symbol: type metadata for Swift.String
Undefined symbol: Swift._stringCompareWithSmolCheck(_: Swift._StringGuts, _: Swift._StringGuts, expecting: Swift._StringComparisonResult) -> Swift.Bool
Undefined symbol: type metadata for Swift.AnyHashable
Undefined symbol: (extension in Foundation):Swift.Error.localizedDescription.getter : Swift.String
Undefined symbol: nominal type descriptor for Swift.CollectionOfOne
Undefined symbol: _swift_isUniquelyReferenced_nonNull_native
Undefined symbol: __swift_FORCE_LOAD_$_swiftUIKit
Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteral
Undefined symbol: associated conformance descriptor for Swift.ExpressibleByIntegerLiteral.Swift.ExpressibleByIntegerLiteral.IntegerLiteralType: Swift._ExpressibleByBuiltinIntegerLiteral
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreFoundation
Undefined symbol: value witness table for Builtin.UnknownObject
Undefined symbol: method descriptor for Swift.ExpressibleByFloatLiteral.init(floatLiteral: A.FloatLiteralType) -> A
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreAudio
Undefined symbol: protocol descriptor for Swift.ExpressibleByIntegerLiteral
Undefined symbol: _swift_dynamicCast
Undefined symbol: protocol conformance descriptor for <A where A == Swift.UInt8> Swift.CollectionOfOne<A> : Foundation.ContiguousBytes in Foundation
Undefined symbol: value witness table for Builtin.Int32
Undefined symbol: type metadata accessor for (extension in Foundation):Swift.String.Encoding
Undefined symbol: _swift_retain
Undefined symbol: __swift_FORCE_LOAD_$_swiftMetal
Undefined symbol: Swift.AnyHashable._rawHashValue(seed: Swift.Int) -> Swift.Int
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreGraphics
Undefined symbol: type metadata for Any
Undefined symbol: protocol witness table for Swift.Float : Swift._ExpressibleByBuiltinFloatLiteral in Swift
Undefined symbol: __swift_FORCE_LOAD_$_swiftFoundation
Undefined symbol: _swift_getForeignTypeMetadata
Undefined symbol: method descriptor for Swift.ExpressibleByIntegerLiteral.init(integerLiteral: A.IntegerLiteralType) -> A
Undefined symbol: nominal type descriptor for Swift._DictionaryStorage
Undefined symbol: static Swift._DictionaryStorage.copy(original: Swift.__RawDictionaryStorage) -> Swift._DictionaryStorage<A, B>
Undefined symbol: _swift_willThrow
Undefined symbol: _swift_endAccess
Undefined symbol: __swift_FORCE_LOAD_$_swiftObjectiveC
Undefined symbol: _swift_errorRelease
Undefined symbol: protocol witness table for Swift.Int : Swift._ExpressibleByBuiltinIntegerLiteral in Swift
Undefined symbol: _swift_getTypeByMangledNameInContext
Undefined symbol: (extension in Foundation):Swift.Array._bridgeToObjectiveC() -> __C.NSArray
Undefined symbol: associated type descriptor for Swift.ExpressibleByFloatLiteral.FloatLiteralType
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreMedia
Undefined symbol: Foundation.__DataStorage.init(capacity: Swift.Int) -> Foundation.__DataStorage
Undefined symbol: __swift_FORCE_LOAD_$_swiftQuartzCore
Undefined symbol: _swift_release
Undefined symbol: static Swift._DictionaryStorage.resize(original: Swift.__RawDictionaryStorage, capacity: Swift.Int, move: Swift.Bool) -> Swift._DictionaryStorage<A, B>
Undefined symbol: associated conformance descriptor for Swift.ExpressibleByFloatLiteral.Swift.ExpressibleByFloatLiteral.FloatLiteralType: Swift._ExpressibleByBuiltinFloatLiteral
Undefined symbol: _swift_getErrorValue
Undefined symbol: __swift_FORCE_LOAD_$_swiftDarwin
How can I fix this issue. I already tried adding a Swift file and bridge file. But that doesnt work.Please help me
Xcode version : 13.0,
React Native Version : 0.64.2,
iOS simulator 15,
Mac OS: 11.4,
For those who still have this issue you can try out the following because it worked for me:
The link to the original post: https://dev.to/mngyuan/updating-react-native-projects-for-m1-mac-development-1mk4
We're going to exclude the arm64 architecture from our build. Under Targets, select your project -> Build Settings -> Excluded Architectures, and add Any IOS Simulator SDK : arm64 for both Debug and Release. Do the same for your Pods project.
If your project for some reason has VALID_ARCHS set, you'll want to remove that key from your project as well (and the Pods project) at this stage.
We're very close to done, but the version of Flipper installed in your pods is likely not new enough to include the fixes for M1 macs. Open ios/Podfile and apply the following
use_flipper!
use_flipper!({ 'Flipper' => '0.75.0' })
And update your Pods
cd ios/
optionally reinstall all your Pods if you're still having issues
pod deintegrate
pod update
If you performed a build which failed, you might want to clear DerivedData like so
rm -rf ~/Library/Developer/Xcode/DerivedData/
Since am running react-native 0.64 I also had to add this to my pod file

Opencv linker error while cross-compiling the sample cpp (libopencv_calib3d.so: could not read symbols)

I am trying to cross compile a sample OpenCV cpp code for my beaglebone which has a ARM Cortex A8 based AM3359 processor. However when I start the cross-compiling I get the following error:
/usr/local/lib/libopencv_calib3d.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
It seems like a linker error. I am pretty sure that there is nothing wrong with libopencv_calib3d.so. Because when I compile the program for my PC, everything works fine. Therefore maybe the problem is with the method that I am using for cross compiling. Here is what I do:
I wrote a script in the name of compile_opencvarm.sh:
echo "Cross-Compiling $1"
if [[ $1 == *.c ]]
then
arm-linux-gnueabi-gcc -ggdb `pkg-config --cflags opencv` -o `basename $1 .c` $1 `pkg-config --libs opencv`;
elif [[ $1 == *.cpp ]]
then
arm-linux-gnueabi-g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`;
else
echo "Please compile only .c or .cpp files with this script"
fi
echo "Cross-Compiled Output => ${1%.*}"
and then added it to bashrc:
alias opencv_arm="~/.compile_opencvarm.sh"
Now when I do:
root#ghostrider:/home/zero/Desktop# opencv_arm peopledetect.cpp
Cross-Compiling peopledetect.cpp
/usr/local/lib/libopencv_calib3d.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
Cross-Compiled Output => peopledetect
Only difference with compiling script and cross-compiling script is that I used arm-linux-gnueabi prefix in the cross-compiling script. When I only compile the cpp file:
root#ghostrider:/home/zero/Desktop# opencv peopledetect.cpp
compiling peopledetect.cpp
Output file => peopledetect
Everything is OK. Program is executable.
Now what do you think my problem is? Is it a linker error or is it related to my cross-compiling process?
Regards
edit: Oh, now I noticed that I did not install arm-based cross libraries before the arm-linux-gnueabi compiler used them. So I installed them with:
sudo xapt -a armel -m libv4l-dev libgtk2.0-dev libcv-dev libcvaux-dev libhighgui-dev
and edited the script as following:
arm-linux-gnueabi-g++ -ggdb `arm-linux-gnueabi-pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `arm-linux-gnueabi-pkg-config --libs opencv`;
But now I get the problem:
root#ghostrider:/home/zero/Desktop# opencv_arm peopledetect.cpp
compiling peopledetect.cpp
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: warning: liblapack.so.3gf, needed by /usr/arm-linux-gnueabi/lib/libcxcore.so, not found (try using -rpath or -rpath-link)
/tmp/ccDzUCLJ.o: In function `main':
/home/zero/Desktop/peopledetect.cpp:49: undefined reference to `cv::HOGDescriptor::setSVMDetector(cv::_InputArray const&)'
/home/zero/Desktop/peopledetect.cpp:84: undefined reference to `cv::HOGDescriptor::detectMultiScale(cv::Mat const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, double, cv::Size_<int>, cv::Size_<int>, double, double, bool) const'
/tmp/ccDzUCLJ.o: In function `cv::Mat::operator=(cv::Mat const&)':
/usr/include/opencv2/core/mat.hpp:317: undefined reference to `cv::Mat::copySize(cv::Mat const&)'
/tmp/ccDzUCLJ.o: In function `cv::Mat::release()':
/usr/include/opencv2/core/mat.hpp:382: undefined reference to `cv::Mat::deallocate()'
/tmp/ccDzUCLJ.o: In function `_InputArray<float>':
/usr/include/opencv2/core/mat.hpp:1108: undefined reference to `vtable for cv::_InputArray'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dgelsd_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dpotrf_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dpotri_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dsyevr_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dgesv_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dpotrs_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dgetri_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `sgels_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `sgesv_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dgetrf_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `sgetrf_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dgels_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `spotrf_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `sgelsd_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `sgesdd_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `spotri_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `ssyevr_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `dgesdd_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `spotrs_'
/usr/arm-linux-gnueabi/lib/libcxcore.so: undefined reference to `sgetri_'
collect2: ld returned 1 exit status
Output file => peopledetect
I solved my problem by cross-compiling all the OpenCV libraries by following this guide: http://processors.wiki.ti.com/index.php/Building_OpenCV_for_ARM_Cortex-A8
I followed this guide but "lnclude/opencv2" directory in the root of opencv distributive is empty after the building. So in fact i have libraries but dont have headers. What am i doing wrong?
UPD: I should be a little more careful, all answers in http://processors.wiki.ti.com/index.php/Building_OpenCV_for_ARM_Cortex-A8

Resources