SwiftGD icon indicating copy to clipboard operation
SwiftGD copied to clipboard

gdImagePtr not found in 2.5.0, but found in 2.4.0

Open axello opened this issue 5 years ago • 9 comments

I have a strange regression bug. Version 2.5.0 gives tons of `use of undeclared type 'gdImagePtr' errors, but v2.4.0 does not.

steps taken:

  • SwiftGD 2.5.0 could not find gdImagePtr
  • brew reinstall gd
  • remove .build
  • clean project etc.
  • Double-check double setting of /usr/local/lib
  • downgraded to SwiftGD 2.4.0
  • In the end removing the xcodeproj was the only thing which worked

However, when I upgraded to SwiftGD 2.5.0 again, removing the xcodeproj and deep cleaning the build folder, and adding the library search paths did not work anymore.

  • Saved both build logs
  • downgraded to SwiftGD 2.4.0

The only discrepancy I see, is that the Format.swift file is in different positions: 2.4.0: checkouts/SwiftGD/Sources/Format.swift 2.5.0: checkouts/SwiftGD/Sources/SwiftGD/Format.swift

Also, it does link with the gd library, as you can see from the compile statement.

Build project5-Package_SwiftGD2.5.0.txt.zip Build project5-Package_SwiftGD2.4.0.txt.zip

axello avatar Feb 21 '20 10:02 axello

Could you see if this problem exists with a fresh project? I just tried it (macOS Catalina) and had no problems on 2.5.0.

twostraws avatar Feb 22 '20 13:02 twostraws

Sure, this was indeed an old project from 2018 (when the book came out)

Axel

On 22 Feb 2020, at 14:51, Paul Hudson [email protected] wrote:

Could you see if this problem exists with a fresh project? I just tried it (macOS Catalina) and had no problems on 2.5.0.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/twostraws/SwiftGD/issues/24?email_source=notifications&email_token=AABEN6KZD2TNATRU6MTOQSLREEUX7A5CNFSM4KZAAH72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVAYRY#issuecomment-589958215, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEN6PDEYDFRJ7IBYNU62DREEUX7ANCNFSM4KZAAH7Q.

axello avatar Feb 22 '20 16:02 axello

I get this bug whilst on a new project following Server-side Swift: Vapor (on Catalina)

zcjhnsn avatar Mar 01 '20 01:03 zcjhnsn

I have same problem MacOSX 10.15.3 Screen Shot 1398-12-21 at 9 56 38 PM

sinakhanjani avatar Mar 11 '20 18:03 sinakhanjani

Having the same problem as well

aryamansharda avatar Apr 09 '20 00:04 aryamansharda

Having the same problem following the steps outlined for the project in Serverside Swift Vapor. Any solutions yet?

jklompje avatar May 19 '20 14:05 jklompje

Same problem(((

matthew86matthew avatar May 21 '20 10:05 matthew86matthew

Same with me. Forward to 2023. 😟 Is there any other library support for both mac and linux? 😟 I'm guessing it has something to do with the architecture?

jcbriones avatar Nov 07 '23 14:11 jcbriones

Troubleshooting ideas

  1. macOS: Make sure you have brew installed. Link
  2. Try manually installing
  3. Make sure your gd version is up to date.
    • macOS brew update gd
    • Ubuntu / deb - sudo apt-get upgrade libgd-dev
  4. If none of the above are working, try upgrading your package manager itself.
    • macOS brew upgrade
    • Ubuntu / deb - sudo apt-get update

Note

Apologies for posting off-topic. But I'm trying to address the frustrations I see posted here.

Additional details

The Package.swift file in this project has a dependency on the gd library which must be installed on your system for this to work at all. SwiftGD is a wrapper for the gd framework. For macOS users, this will mean installing with brew.

mcritz avatar Nov 07 '23 16:11 mcritz