You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
XCode 9.4.1 (9F2000)
Homebrew 1.7.3
gtk3, from Homebrew: gtk+3: stable 3.22.30 (bottled)
Additional Detail from JIRA
Votes
0
Component/s
Package Manager
Labels
Bug
Assignee
None
Priority
Medium
md5: f69a9e1e0a1b22549844a804414d7868
Issue Description:
I am trying to link to gtk3 with swift 4.1.2 but it is failing to find the headers (that is, it fails before the link stage). I have two repos on github that demonstrate the issue:
CGtk3 - here pkgConfig is setup just like the official documentation.
When I try to build Gtk3 from above, I get the following error:
$ swift build
Fetching git@github.com:TaborKelly/CGtk3.git
Cloning git@github.com:TaborKelly/CGtk3.git
Resolving git@github.com:TaborKelly/CGtk3.git at 0.1.0
Compile Swift Module 'Gtk3' (1 sources)
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "shim.h"
^
/Users/tabor.kelly/work/Gtk3/.build/checkouts/CGtk3.git-1657053074184707870/shim.h:4:10: error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^
/Users/tabor.kelly/work/Gtk3/Sources/main.swift:3:8: error: could not build Objective-C module 'CGtk3'
import CGtk3
^
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/tabor.kelly/work/Gtk3/.build/debug.yaml main output:
Please note that pkg-config does know how to find these headers:
This is happening because gtk has a dependency on glib which is adding `-Wl,-framework -Wl,CoreFoundation` linker flags. SwiftPM doesn't know about these flags and emits a warning about non-whitelisted flags. You're not seeing the warnings because there was a bug in older swiftpm that caused it to not emit these warnings. The solution here to add -Wl to the whitelist. Also, please use the latest version of the manifest API. I am attaching the equivalent package with Swift 4.2 manifest. As a workaround, you can remove the -Wl flags from glib's pkgConfig file.
Attachment: Download
Environment
macOS 10.13.6
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
XCode 9.4.1 (9F2000)
Homebrew 1.7.3
gtk3, from Homebrew: gtk+3: stable 3.22.30 (bottled)
Additional Detail from JIRA
md5: f69a9e1e0a1b22549844a804414d7868
Issue Description:
I am trying to link to gtk3 with swift 4.1.2 but it is failing to find the headers (that is, it fails before the link stage). I have two repos on github that demonstrate the issue:
CGtk3 - here pkgConfig is setup just like the official documentation.
Gtk3 - just a Hello World importing CGtk3
When I try to build Gtk3 from above, I get the following error:
Please note that pkg-config does know how to find these headers:
Specifically,
gtk/gtk.h
is located in/usr/local/Cellar/gtk+3/3.22.30/include/gtk-3.0
.Additionally, have told CGtk3 to use the pkg-config information for gtk+-3.0:
Please let me know if there is any other information which I can provide.
The text was updated successfully, but these errors were encountered: