Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-179] Including Gtk header (gtk/gtk.h) in a module - can't find gdk/gdk.h #5442

Closed
swift-ci opened this issue Dec 10, 2015 · 4 comments
Closed
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-179
Radar None
Original Reporter Lanza (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Linux from scratch (~7.8), x86_64 - systemd - Gnome/Gtk+ 3.18
Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift f25b887686)
Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 1
Component/s Compiler, Package Manager
Labels Bug
Assignee None
Priority Medium

md5: 2291c7682614c944c65753a6cdb17259

duplicates:

  • SR-145 Need a way to add include paths in modulemap

Issue Description:

When trying to include gtk.h from a module, swift complains it can't find gdk.h

<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "/usr/include/gtk-3.0/gtk/gtk.h"
         ^
/usr/include/gtk-3.0/gtk/gtk.h:30:10: error: 'gdk/gdk.h' file not found
#include <gdk/gdk.h>
         ^
main.swift:1:8: error: could not build Objective-C module 'CGtk'
import CGtk

gtk.h sits in /usr/include/gtk-3.0/gtk/gtk.h and gdk.h is in /usr/include/gtk-3.0/gdk/gdk.h

I've tried with package manager and directly using swiftc, I've created a module for gdk, nothing works and it swift still cannot find gdk/gdk.h

@swift-ci
Copy link
Contributor Author

Comment by Y.E. Kwon (JIRA)

This is a same issue with https://bugs.swift.org/browse/SR-145

@mxcl
Copy link
Contributor

mxcl commented Dec 24, 2015

In fact the problem here is GDK needs its own module.

@mxcl
Copy link
Contributor

mxcl commented Dec 24, 2015

You can work around this by adding GDK to the same module map:

module CGTK [system] {
    header "/usr/include/gtk-3.0/gtk/gtk.h"
    link "gtk-3"
    export *
}

module CGDK [system] {
    header "/usr/include/gdk-3.0/gdk/gdk.h"
    link "gdk-3"
    export *
}

As specified in the documentation, module map dependencies must be specified all the way down.

@abertelrud
Copy link
Contributor

It's possible that SE-0063 can also help here.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants