GEOSwift / geos

GEOS packaging for SPM & CocoaPods
GNU General Public License v2.0
12 stars 22 forks source link

Geos does not compile on iOS 12 SDKs... #2

Closed hactar closed 5 years ago

hactar commented 5 years ago

I don't know if this issue is appropriate here on the upstream geos library, but as you guys are the swift guys I'm posting it here.

iOS 12 has dropped libstdc++, hence geos does not compile with the newest Xcode, instead you get the error:

'stdexcept' file not found

The drop is being discussed here for example...

https://stackoverflow.com/questions/50694822/xcode-10-ios-12-does-not-contain-libstdc6-0-9

In order for this to work in future, it appears geos would need to be updated to use libc++ instead...

kazuomatz commented 5 years ago

Try changing PodFile as follows.

source 'https://github.com/CocoaPods/Specs.git'
platform :ios,'9.0'  
project './example.xcodeproj'
use_frameworks!

target 'example'  do
    pod 'GEOSwift'  
   # and more...
end  

post_install do |installer|  
    installer.pods_project.targets.each do |target|  
        target.build_configurations.each do |config|  
            if target.name == 'geos'  
                # change libstdc++ to libc++
                config.build_settings['CLANG_CXX_LIBRARY'] = 'libc++'  
            end  
        end  
    end  
end  
alexisbar commented 5 years ago

I had the same problem (but using GEOSwift in my custom library so using a podspec instead of a podfile)

I added the post_install in my podpsec, but after installing I had this error :

Include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead

To resolve, go to Pods -> geos -> Build settings -> Apple Clang - Language - C++ Then change "C++ Standard Library" from libstdc++ to libc++

Edit : if you use GEOSwift as a dependency of your library, you do not need the post_install in your podspec, just change the build settings as described above

macdrevx commented 5 years ago

3 should help with this. I'm also working on corresponding updates to GEOSwift that will incorporate #3. I believe @vfn will need to approve & merge these changes.

vfn commented 5 years ago

@macdrevx, https://github.com/GEOSwift/geos/pull/3 looks good! You should be able to merge it now

macdrevx commented 5 years ago

Version 3.7.0 of this pod is now available. It should resolve these issues.