Undefined symbol: _swift_getOpaqueTypeConformance - React Native & SwiftUI - objective-c

I'm trying to port a SwiftUI view into react native following this guide. It build fine in swift project but not in a react native project.
I'm getting the following error:
Undefined symbols for architecture x86_64:
"_swift_getOpaqueTypeConformance", referenced from:
lava.ColorWheelView.body.getter : some in ColorWheelView.o
closure #2 (SwiftUI.GeometryProxy) -> <<opaque return type of lava.ColorWheelView.makeView(SwiftUI.GeometryProxy) -> some>>.0 in lava.ColorWheelView.body.getter : some in ColorWheelView.o
associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.ColorWheelView : SwiftUI.View in lava in ColorWheelView.o
l_get_witness_table qd0__7SwiftUI4ViewHD3_AaBPAAE7gesture_9includingQrqd___AA11GestureMaskVtAA0F0Rd__lFQOyAA15ModifiedContentVyAA6ZStackVyAA05TupleC0VyAJyAA06_ShapeC0VyAA9RectangleVAA5ColorVGAA12_FrameLayoutVG_AJy4lava010GuitarPickC0VAA13_OffsetEffectVGtGGAA09_PositionP0VG_AA06_EndedF0VyAA0f5StateF0VyAA08_ChangedF0VyAA04DragF0VGSo7CGPointVSgGGQo_HO in ColorWheelView.o
associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.TrianglePath : SwiftUI.View in lava in GuitarPickView.o
associated type witness table accessor for SwiftUI.View.Body : SwiftUI.View in lava.GuitarPickView : SwiftUI.View in lava in GuitarPickView.o
"_swift_getTypeByMangledNameInContextInMetadataState", referenced from:
___swift_instantiateConcreteTypeFromMangledNameAbstract in ColorWheelView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To reproduce I made this Github repo
Copy those files in a react native project and try to build. Make sure to replace the header file import with your test project name "<Replace This>-Swift.h"
My build target is iOS 13.5 iPhone 11 Pro Max simulator.

Related

Problems compiling with libsoup (gstreamer)

I have build the gst-build Gstreamer 1.18 version, after installing libsoup2.4-dev and I can see that the dependency is detected:
|Dependency libsoup-2.4 found: YES 2.62.1 (cached).
Later on, compiling the project that I am developing related with WebRTC I have the following issue. How can I solve it?
undefined reference to `soup_websocket_connection_close'
undefined reference to `soup_logger_new'
undefined reference to `soup_websocket_connection_get_state'
undefined reference to `soup_message_new'
undefined reference to `soup_session_websocket_connect_async'
undefined reference to `soup_session_new_with_options'
undefined reference to `soup_session_websocket_connect_finish'
undefined reference to `soup_session_add_feature'
undefined reference to `_SOUP_METHOD_GET'
undefined reference to `soup_websocket_connection_send_text'
undefined reference to `soup_session_feature_get_type
collect2: error: ld returned 1 exit status

undefined reference to `__cxa_throw_bad_array_new_length

There are several posts citing this (or similar) undefined references, but none of those was of help.
I have code which compiles nicely on gentoo 4.14.83, with both gcc-7.3.0 and gcc-8.2.0.
On CentOS 7 (CentOS Linux release 7.6.1810 (Core)), however, the linker of g++-7.3.1 says:
/home/jody/progs/multi_spc_QHG3/kernel/Geography.cpp:68: undefined reference to `__cxa_throw_bad_array_new_length'
/home/jody/progs/multi_spc_QHG3/kernel/Geography.cpp:69: undefined reference to `__cxa_throw_bad_array_new_length'
/home/jody/progs/multi_spc_QHG3/kernel/Geography.cpp:70: undefined reference to `__cxa_throw_bad_array_new_length'
/home/jody/progs/multi_spc_QHG3/kernel/Geography.cpp:71: undefined reference to `__cxa_throw_bad_array_new_length'
The referenced lines in Geography.cpp have simple new statements:
m_adLatitude = new geonumber[m_iNumCells];
m_adLongitude = new geonumber[m_iNumCells];
m_adAltitude = new geonumber[m_iNumCells];
m_adDistances = new geonumber[m_iNumCells*m_iMaxNeighbors];
(the type geonumber is actually double, m_iNumCells and m_iMaxNeighbors have type int)
Because i need g++ version 7, i use the compiler from devtoolset-7-gcc.x86_64.
Some of the posts i found stated that this error is caused by missing libstdc++, but this is not the case here.
What causes this error, and how can it be fixed?

connected to the project at Ada QT libraries

When connecting to a project on Ada QT library produces errors.
with QT; use QT;
.....
Log.
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x14): undefined reference to QChar1_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x30): undefined reference toQChar2_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x5a): undefined reference to QChar3_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x6f): undefined reference toQChar4_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0x8b): undefined reference to QChar5_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xa7): undefined reference toQChar6_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xbb): undefined reference to QChar7_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xcf): undefined reference toQChar8_create'
E:\GNAT\2013\qtada\qt-qchar.o:qt-qchar.adb:(.text+0xe3): undefined reference to QChar_latin1'
e:/gnat/2013/bin/../libexec/gcc/i686-pc-mingw32/4.7.4/ld.exe: E:\GNAT\2013\qtada\qt-qchar.o: bad reloc address 0x20 in section.eh_frame'
e:/gnat/2013/bin/../libexec/gcc/i686-pc-mingw32/4.7.4/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
gprbuild: link of main.adb failed
[2014-04-28 08:15:40] process exited with status 4 (elapsed time: 01.50s)
Are your installed QT,QTADA libraries compatible with the Mingw-Toolchain? Also regarding the bitness 32/64. The Versions of your libraries and the compile/linker command would be helpful.
You might also consider following hint:
GMP with MinGW on Windows

Mounting a network volume from OS X App

I'm trying to mount a network volume in a OS X App.
I get it to work using the FSMountServerVolume function which is deprecated. The documentation says "To mount a network volume, use NetFSMountURLAsync instead". But when I try to use this function I get the following error message:
dyld: lazy symbol binding failed: Symbol not found: _NetFSMountURLSync
Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/AppName-ammmlfwhvlfxkdburfmzioformdn/Build/Products/Debug/AppName.app/Contents/MacOS/AppName
Expected in: /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
dyld: Symbol not found: _NetFSMountURLSync
Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/AppName-ammmlfwhvlfxkdburfmzioformdn/Build/Products/Debug/AppName.app/Contents/MacOS/AppName
Expected in: /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
Did I forget anything? I imported the NetFS Framework.
OK, it looks like NetFSMountURLSync() etc where introduced in 10.8.
From NetFS Changes:
Added AsyncRequestID
Added NetFSMountURLAsync()
Added NetFSMountURLBlock
Added NetFSMountURLCancel()
Added NetFSMountURLSync()
Added #def kNAUIOptionAllowUI
Added #def kNAUIOptionForceUI
Added #def kNAUIOptionKey
Added #def kNAUIOptionNoUI
Added #def kNetFSMountAtMountDirKey
Therefore you are going to have to use the "old way" in 10.7 and below and the "new way" in 10.8 and above. This means making the NetFS.framework optional rather than required and the need to perform various runtime checks to see which API you need to use.

OCMock - trying to mock NSEntityDescription

in order to test a managed class I tried to create an instance in a unit test by first trying to mock NSEntityDescription and NSManagedObjectContext.
id mockEntityDesc = [OCMockObject niceMockForClass:[NSEntityDescription class]];
id mockManagedObjectContext = [OCMockObject mockForClass:NSManagedObjectContext.class];
But before I can get any further I get the following error when test is run;
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NSEntityDescription", referenced from:
objc-class-ref in CallsCoordinatorTests.o
"_OBJC_CLASS_$_NSManagedObjectContext", referenced from:
objc-class-ref in CallsCoordinatorTests.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any advice please?
Thanks
Your unit test target is not linking with the Core Data framework.