<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: compile-time error when including ArcGIS SDK into Xcode project with other c++ co in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382156#M3280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fixed! Two options: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) If I move my linkage to the ArcGIS SDK from my target settings to my project settings, I can build. Targets using the ArcGIS SDK will need an $(inherited) flag in the Framework Search Paths field. I typically do all my framework/library linkage in the target settings on the general principle that my project might end up with multiple targets using different components, and I have never had an issue with this before. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not understand *why* this makes a difference; the build looks exactly the same (same linker flags, etc.) and my understanding is that target level settings simply add to or override project level settings *before* everything is fed into the compiler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) If I switch the default c++ library to libstdc++, I can build without doing 1). This is accomplished via the c++ standard library field in the project or target settings and I should have seen it right away. Changing that field will prevent LLVM from adding the -stdlib=libc++ flag, as per eric5320's suggestion. However, my understanding is that libc++ offers some substantial advantages over libstdc++. Having to make a project-wide change like that to accommodate one framework is unfortunate.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2012 18:34:32 GMT</pubDate>
    <dc:creator>DanaMaher</dc:creator>
    <dc:date>2012-10-23T18:34:32Z</dc:date>
    <item>
      <title>compile-time error when including ArcGIS SDK into Xcode project with other c++ code</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382153#M3277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am unable to use the ArcGIS SDK for iOS in an XCode project that uses c++ code. If I create a new project in XCode, add an empty c++ file, and then &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/runtime-ios-sdk/apiref/index.htm" rel="nofollow" target="_blank"&gt;link to the ArcGIS SDK for iOS&lt;/A&gt;&lt;SPAN&gt;, I get a series of errors under the header "undefined symbols for architecture i386." See attached text file for the complete error log. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I pull out the c++ class, I can proceed to write an app that leverages the ArcGIS SDK for iOS. If I pull out the SDK, I can proceed to write an app that uses some c++ code. However, I need the ArcGIS SDK and an iOS build of the OpenCV library to play nicely within the same project. Previously, I have had no issues including c++ code in my XCode projects using the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://answers.oreilly.com/topic/631-how-to-get-c-and-objective-c-to-play-nicely-in-xcode/" rel="nofollow" target="_blank"&gt;rules outlined here&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Typically, I see "undefined symbol..." errors when I forget to include a library or framework needed by some code in my project. For instance, if I set up an XCode project to use the ArcGIS SDK and I forgot to include libstdc++, I get a longer list of "undefined symbols for architecture i386" errors. In fact, the errors I am currently seeing are a subset of the errors resulting from not including libstdc++. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My guess is that when LLVM compiles a project that includes c++ code, it adjusts itself in a way that breaks the ArcGIS SDK's linkage with libstdc++. Or libstdc++ gets ignored for some other c++ library that is not quite equivalent. I base this guess on the observation that the errors I am seeing are a subset of the errors I get by not including libstdc++ and the observation that when building with c++ code in the project, I see an additional -stdlib=libc++ flag in the link phase of the compile. A -lstdc++ flag is also present since I am linking to libstdc++ in order to use the ArcGIS for iOS SDK. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I on track? If so, can I adjust the compiler settings to get around this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2012 22:59:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382153#M3277</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2012-10-22T22:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: compile-time error when including ArcGIS SDK into Xcode project with other c++ co</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382154#M3278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Looking at your linker flags: I think the problem is the stdlib being libc++, it should be libstdc++. Can you retry with that as your stdlib?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/dcmaher/Library/Developer/Xcode/DerivedData/IG_ImageTracker-ctpdysoeefapnhaunikodxdioslg/Build/Products/Debug-iphonesimulator -F/Users/dcmaher/Library/Developer/Xcode/DerivedData/IG_ImageTracker-ctpdysoeefapnhaunikodxdioslg/Build/Products/Debug-iphonesimulator -F/Users/dcmaher/Library/SDKs/ArcGIS -filelist /Users/dcmaher/Library/Developer/Xcode/DerivedData/IG_ImageTracker-ctpdysoeefapnhaunikodxdioslg/Build/Intermediates/IG_ImageTracker.build/Debug-iphonesimulator/IG_ImageTracker.build/Objects-normal/i386/IG_ImageTracker.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load -framework ArcGIS -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs &lt;/SPAN&gt;&lt;STRONG&gt;-stdlib=libc++&lt;/STRONG&gt;&lt;SPAN&gt; -mios-simulator-version-min=6.0 -lstdc++ -framework CoreLocation -framework CoreText -lz -framework MediaPlayer -framework MobileCoreServices -framework QuartzCore -framework Security -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/dcmaher/Library/Developer/Xcode/DerivedData/IG_ImageTracker-ctpdysoeefapnhaunikodxdioslg/Build/Products/Debug-iphonesimulator/IG_ImageTracker.app/IG_ImageTracker&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 16:43:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382154#M3278</guid>
      <dc:creator>EricIto</dc:creator>
      <dc:date>2012-10-23T16:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: compile-time error when including ArcGIS SDK into Xcode project with other c++ co</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382155#M3279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Looking at your linker flags: I think the problem is the stdlib being libc++, it should be libstdc++. Can you retry with that as your stdlib? &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Eric, the compiler adds that particular flag when it finds c++ code in a project. I am not setting it anywhere. As you can see, the libstdc++ flag that must be explicitly added to compile the ArcGIS SDK is also present. I think you and I are in agreement about the basic problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure where in the build settings panel I would tell the compiler not to include the libc++ flag and I believe libc++ is needed to build c++ code in the project. I know that Apple's LLVM compiler switched from libstdc++ to libc++ a while back and that the two libraries are mangled differently by the compiler, so removing libc++ seems like it might solve the ArcGIS SDK issue but prevent my c++ code from compiling.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 17:58:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382155#M3279</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2012-10-23T17:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: compile-time error when including ArcGIS SDK into Xcode project with other c++ co</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382156#M3280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fixed! Two options: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) If I move my linkage to the ArcGIS SDK from my target settings to my project settings, I can build. Targets using the ArcGIS SDK will need an $(inherited) flag in the Framework Search Paths field. I typically do all my framework/library linkage in the target settings on the general principle that my project might end up with multiple targets using different components, and I have never had an issue with this before. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not understand *why* this makes a difference; the build looks exactly the same (same linker flags, etc.) and my understanding is that target level settings simply add to or override project level settings *before* everything is fed into the compiler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) If I switch the default c++ library to libstdc++, I can build without doing 1). This is accomplished via the c++ standard library field in the project or target settings and I should have seen it right away. Changing that field will prevent LLVM from adding the -stdlib=libc++ flag, as per eric5320's suggestion. However, my understanding is that libc++ offers some substantial advantages over libstdc++. Having to make a project-wide change like that to accommodate one framework is unfortunate.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 18:34:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382156#M3280</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2012-10-23T18:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: compile-time error when including ArcGIS SDK into Xcode project with other c++ co</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382157#M3281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Additional option: Wrap c++ code in the project &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://robnapier.net/blog/wrapping-c-take-2-1-486" rel="nofollow" target="_blank"&gt;using this method&lt;/A&gt;&lt;SPAN&gt;. This compartmentalizes the c++, removes the need to use Objective-C++ except for in wrapper classes, and prevents the compile-time error I was seeing.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 19:11:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/compile-time-error-when-including-arcgis-sdk-into/m-p/382157#M3281</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2012-10-24T19:11:17Z</dc:date>
    </item>
  </channel>
</rss>

