twostraws / SwiftGD

A simple Swift wrapper for libgd
MIT License
454 stars 71 forks source link

header '/usr/include/gd.h' not found #4

Open ibrahimkteish opened 7 years ago

ibrahimkteish commented 7 years ago

Package.swift content:

import PackageDescription let package = Package( name: "project5", dependencies: [ .Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1), .Package(url: "https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git", majorVersion: 1), .Package(url: "https://github.com/IBM-Swift/HeliumLogger.git", majorVersion: 1), .Package(url: "https://github.com/twostraws/SwiftGD.git", majorVersion: 1) ] ) OP: MacOS Sierra/Ubuntu 16.04 (DigitalOcean) Env: Docker using ibmcom/swift-ubuntu:latest/ also I tried it without docker

root@bb33f543917b:/projects/project5# swift build Compile Swift Module 'SwiftGD' (1 sources) Compile CHTTPParser utils.c Compile Swift Module 'KituraStencil' (1 sources) Compile CHTTPParser http_parser.c /projects/project5/.build/checkouts/Cgd.git--1390626494485699789/module.modulemap:2:9: error: header '/usr/include/gd.h' not found header "/usr/include/gd.h" ^ /projects/project5/.build/checkouts/SwiftGD.git-1170172309405307774/Sources/SwiftGD.swift:3:9: error: could not build Objective-C module 'Cgdlinux' import Cgdlinux ^ :0: error: build had 1 command failures error: exit(1): /usr/bin/swift-build-tool -f /projects/project5/.build/debug.yaml

ibrahimkteish commented 7 years ago

Ubuntu Output:

root@smart:~# mkdir swiftGD root@smart:~# cd swiftGD/ root@smart:~/swiftGD# swift package init --type executable Creating executable package: swiftGD Creating Package.swift Creating .gitignore Creating Sources/ Creating Sources/main.swift Creating Tests/ root@smart:~/swiftGD# vi Package.swift root@smart:~/swiftGD# swift build Fetching https://github.com/IBM-Swift/Kitura.git Fetching https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git Fetching https://github.com/IBM-Swift/HeliumLogger.git Fetching https://github.com/twostraws/SwiftGD.git Fetching https://github.com/IBM-Swift/Kitura-net.git Fetching https://github.com/IBM-Swift/SwiftyJSON.git Fetching https://github.com/IBM-Swift/Kitura-TemplateEngine.git Fetching https://github.com/IBM-Swift/LoggerAPI.git Fetching https://github.com/IBM-Swift/BlueSocket.git Fetching https://github.com/IBM-Swift/CCurl.git Fetching https://github.com/IBM-Swift/BlueSSLService.git Fetching https://github.com/IBM-Swift/CEpoll.git Fetching https://github.com/IBM-Swift/BlueSignals.git Fetching https://github.com/IBM-Swift/OpenSSL.git Fetching https://github.com/kylef/Stencil Fetching https://github.com/kylef/PathKit.git Fetching https://github.com/kylef/Spectre.git Fetching https://github.com/twostraws/Cgd.git Cloning https://github.com/kylef/Spectre.git Resolving https://github.com/kylef/Spectre.git at 0.7.2 Cloning https://github.com/twostraws/SwiftGD.git Resolving https://github.com/twostraws/SwiftGD.git at 1.1.0 Cloning https://github.com/IBM-Swift/SwiftyJSON.git Resolving https://github.com/IBM-Swift/SwiftyJSON.git at 16.0.1 Cloning https://github.com/IBM-Swift/BlueSignals.git Resolving https://github.com/IBM-Swift/BlueSignals.git at 0.9.48 Cloning https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git Resolving https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git at 1.8.2 Cloning https://github.com/IBM-Swift/CCurl.git Resolving https://github.com/IBM-Swift/CCurl.git at 0.4.0 Cloning https://github.com/IBM-Swift/LoggerAPI.git Resolving https://github.com/IBM-Swift/LoggerAPI.git at 1.7.0 Cloning https://github.com/kylef/Stencil Resolving https://github.com/kylef/Stencil at 0.9.0 Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git Resolving https://github.com/IBM-Swift/Kitura-TemplateEngine.git at 1.7.1 Cloning https://github.com/IBM-Swift/CEpoll.git Resolving https://github.com/IBM-Swift/CEpoll.git at 0.1.0 Cloning https://github.com/IBM-Swift/Kitura-net.git Resolving https://github.com/IBM-Swift/Kitura-net.git at 1.7.15 Cloning https://github.com/IBM-Swift/OpenSSL.git Resolving https://github.com/IBM-Swift/OpenSSL.git at 0.3.6 Cloning https://github.com/IBM-Swift/HeliumLogger.git Resolving https://github.com/IBM-Swift/HeliumLogger.git at 1.7.0 Cloning https://github.com/IBM-Swift/BlueSocket.git Resolving https://github.com/IBM-Swift/BlueSocket.git at 0.12.61 Cloning https://github.com/IBM-Swift/BlueSSLService.git Resolving https://github.com/IBM-Swift/BlueSSLService.git at 0.12.48 Cloning https://github.com/IBM-Swift/Kitura.git Resolving https://github.com/IBM-Swift/Kitura.git at 1.7.6 Cloning https://github.com/kylef/PathKit.git Resolving https://github.com/kylef/PathKit.git at 0.8.0 Cloning https://github.com/twostraws/Cgd.git Resolving https://github.com/twostraws/Cgd.git at 0.1.0 Compile Swift Module 'Signals' (1 sources) Compile Swift Module 'Socket' (3 sources) Compile Swift Module 'LoggerAPI' (1 sources) Compile Swift Module 'SwiftGD' (1 sources) /root/swiftGD/.build/checkouts/Cgd.git--7310932728750933443/module.modulemap:2:9: error: header '/usr/include/gd.h' not found header "/usr/include/gd.h" ^ /root/swiftGD/.build/checkouts/SwiftGD.git-6451823937131720639/Sources/SwiftGD.swift:3:9: error: could not build Objective-C module 'Cgdlinux' import Cgdlinux ^ Compile Swift Module 'Spectre' (8 sources) Compile Swift Module 'KituraTemplateEngine' (1 sources) Compile Swift Module 'SwiftyJSON' (2 sources)

:0: error: build had 1 command failures error: exit(1): /swift/swift-3.1.1-RELEASE-ubuntu16.04/usr/bin/swift-build-tool -f /root/swiftGD/.build/debug.yaml
ghost commented 7 years ago

Getting the same thing on a Heroku install. Have added libgd-dev to the Aptfile installed on Heroku.

ibrahimkteish commented 7 years ago

@tobegit Thank you it worked for me too on ubuntu 16.04

Ruckt commented 7 years ago

I am getting this error while using Docker.

tjshae commented 6 years ago

Hmm. libgd-dev in the Aptfile is no longer working on Heroku. I still get the same error:

remote: Compile Swift Module 'SwiftGD' (1 sources) remote: /tmp/build_964bf7f7a7eb98b68ef1e1f060c0ad32/.build/checkouts/Cgd.git--8701043272991523524/module.modulemap:2:9: error: header '/usr/include/gd.h' not found remote: header "/usr/include/gd.h" remote: ^ remote: /tmp/build_964bf7f7a7eb98b68ef1e1f060c0ad32/.build/checkouts/SwiftGD.git-2728462164667119928/Sources/SwiftGD/SwiftGD.swift:3:9: error: could not build C module 'Cgdlinux' remote: import Cgdlinux

mcritz commented 4 years ago

I believe this issue has been fixed in 2.5.0. Can anyone reproduce this in current release?

shial4 commented 1 year ago

It isn't working for me with Swift package manager & Vapor, Neither Docker, nor MacOs

...SourcePackages/checkouts/SwiftGD/Sources/gd/swiftgd_gd.h:1:10 'gd.h' file not found