twostraws / SwiftGD

A simple Swift wrapper for libgd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant link in gd : Use of undeclared type

adirburke opened this issue · comments

Every time I try to build, I get a bunch of Use of undeclared type. I have installed gd through brew
Cant seem to find the issue

Mojave 10.14.5

Screen Shot 2019-06-10 at 11 11 31 am

I fixed the issue by changing hte /gd/module.modulemap header line back to /usr/local/include from umbrella header

@idi888 I am getting the exact same issue.

/gd/module.modulemap header line back to /usr/local/include from umbrella header

Can you let me know where / what the "umbrella" header is please, not having much joy!

Thanks.

@aggsyb SwiftGD/Sources/gd/module.modulemap

I fixed the issue in three steps :

  1. Add /usr/local/lib in Library Search Paths in the Build Settings of SwiftGD and App as indicated by @twostraws in Server Side Swift book

  2. Change .build/checkouts/SwiftGD/Sources/gd/module.modulemap

module gd {
        umbrella header "/usr/local/include/gd.h"
        link "gd"
}
  1. Add /usr/local/include RECURSIVE in Header Search Paths in the Build Settings of SwiftGD

@jpimbert Do you know if there is a way that doesn't require performing these steps each time the Xcode project is regenerated?

@siemensikkema, yes I think there is a way but I presently don't know where to find it 😬
Perhaps by adding a Xcode configuration file, documented here : https://help.apple.com/xcode/mac/current/#/itcaec37c2a6 ?
Perhaps by fixing it in SwiftGD configuration ?

Looks like this is fixed #20 @twostraws any chance you could merge?