0

Umm... kinda self explanatory. I use Xcode 4 and Allegro.

Gabe
  • 85
  • 1
  • 8
  • 2
    Probably not self explanatory enough. You might want to add some details about what you're trying to do and what you've tried so far if you expect any help. – Bill the Lizard Apr 18 '11 at 11:29
  • I've tried putting -lpng, -zlib, and lloadpng in other linker flags. I'm trying to load a png into a bitmap (see Allegro Bitmap Commands Return Black Screen). – Gabe Apr 18 '11 at 14:51
  • Are you getting a linking error? What does it say? – Matthew Apr 19 '11 at 03:53

2 Answers2

5

Go to the Target list, Build Settings, search for "Other linker flags" and add "-lz".

Andrea Bergia
  • 5,502
  • 1
  • 23
  • 38
  • I keep reading that you have to use the -lz flag, but can't find it referenced in the documentation anywhere. It does work, but I want to know why? How do you know this? – bottleboot Dec 07 '14 at 12:22
  • 1
    -lz means link with libz, which is the name of the binary produced by zlib. Analogously, for libpng you'd add -lpng and so on. – Andrea Bergia Dec 07 '14 at 12:24
  • wow that was quick! Thank you very much, that makes a lot of sense – bottleboot Dec 07 '14 at 12:27
4

To link zlib, you need to use -lz as a compiler flag.

xfbs
  • 177
  • 1
  • 1
  • 9