Other Linker Flags "-all_load -ObjC" with duplicate symbols

2631
3
Jump to solution
09-30-2013 02:21 AM
ClementLau
New Contributor
I want to integrate video streaming (VideoStream SDK for iOS) to ArcGIS.  But there are compiling error:

duplicate symbol _ff_inverse in:
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/3rd-party/ffmpeg/lib/libavcodec.a(inverse.o)
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/3rd-party/ffmpeg/lib/libavutil.a(inverse.o)
duplicate symbol _OBJC_IVAR_$_VSReachability.reachabilityRef in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_IVAR_$_VSReachability.localWiFiRef in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_CLASS_$_VSReachability in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_METACLASS_$_VSReachability in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
ld: 5 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When I remove "-all_load -ObjC" in Other Linker Flags, it can be compiled.  But failure in runtime, it cannot find ArcGIS Class.

How can I solve this problem?
0 Kudos
1 Solution

Accepted Solutions
EricIto
New Contributor III
I want to integrate video streaming (VideoStream SDK for iOS) to ArcGIS.  But there are compiling error:

duplicate symbol _ff_inverse in:
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/3rd-party/ffmpeg/lib/libavcodec.a(inverse.o)
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/3rd-party/ffmpeg/lib/libavutil.a(inverse.o)
duplicate symbol _OBJC_IVAR_$_VSReachability.reachabilityRef in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_IVAR_$_VSReachability.localWiFiRef in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_CLASS_$_VSReachability in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_METACLASS_$_VSReachability in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
ld: 5 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When I remove "-all_load -ObjC" in Other Linker Flags, it can be compiled.  But failure in runtime, it cannot find ArcGIS Class.

How can I solve this problem?


The issue you are having is not related to the ArcGIS Runtime SDK for iOS. It's due to the fact that the static library (VideoStreamSDK.a) you are linking against contains the VSReachability.o object file. Then, at your app level, you are also compiling the same SDK files again, resulting in multiple object files containing the same symbols. If you remove the app level version of the VideoStreamSDK files, your duplicate symbols will go away and your app will build and link successfully.

You will want to do one or the other: link the VideoStreamSDK.a or compile the source files into your app.

Eric

View solution in original post

0 Kudos
3 Replies
HumzaAkhtar
Occasional Contributor II
Are you using another API in your project besides ArcGIS?
0 Kudos
DiveshGoyal
Esri Regular Contributor
Thanks for reporting. We'll look into this.
Unfortunately, I don't have any workarounds to offer at the moment.
0 Kudos
EricIto
New Contributor III
I want to integrate video streaming (VideoStream SDK for iOS) to ArcGIS.  But there are compiling error:

duplicate symbol _ff_inverse in:
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/3rd-party/ffmpeg/lib/libavcodec.a(inverse.o)
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/3rd-party/ffmpeg/lib/libavutil.a(inverse.o)
duplicate symbol _OBJC_IVAR_$_VSReachability.reachabilityRef in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_IVAR_$_VSReachability.localWiFiRef in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_CLASS_$_VSReachability in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
duplicate symbol _OBJC_METACLASS_$_VSReachability in:
/Users/geossd/Library/Developer/Xcode/DerivedData/GInfoMap-ftddshucruzuhsdknuhapqqgagfo/Build/Intermediates/GInfoMap.build/Debug-iphonesimulator/GInfoMap.build/Objects-normal/i386/VSReachability.o
/Users/geossd/Clement/GInfoMap/VideoStreamSDK/VideoStreamSDK.a(VSReachability.o)
ld: 5 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

When I remove "-all_load -ObjC" in Other Linker Flags, it can be compiled.  But failure in runtime, it cannot find ArcGIS Class.

How can I solve this problem?


The issue you are having is not related to the ArcGIS Runtime SDK for iOS. It's due to the fact that the static library (VideoStreamSDK.a) you are linking against contains the VSReachability.o object file. Then, at your app level, you are also compiling the same SDK files again, resulting in multiple object files containing the same symbols. If you remove the app level version of the VideoStreamSDK files, your duplicate symbols will go away and your app will build and link successfully.

You will want to do one or the other: link the VideoStreamSDK.a or compile the source files into your app.

Eric
0 Kudos