makefile and libpng
hi,
I have a fink installed rev of libpng,
/sw/lib/
libpng.3.1.2.5.dylib
libpng.3.dylib
libpng12.0.1.2.5.dylib
libpng.12.0.dylib
Which libpng do I load in my makefile?
How do I load the lib in my link file?
LIBRARIES = -lGL -lGLU -lm -lobjc -lstdc++ <-- and what for libpng?
thanks,
Mike
I have a fink installed rev of libpng,
/sw/lib/
libpng.3.1.2.5.dylib
libpng.3.dylib
libpng12.0.1.2.5.dylib
libpng.12.0.dylib
Which libpng do I load in my makefile?
How do I load the lib in my link file?
LIBRARIES = -lGL -lGLU -lm -lobjc -lstdc++ <-- and what for libpng?
thanks,
Mike
I would assume -LGL, but I don't know much bout libraries. if you are using C++, use -lstdc++
It's not magic, it's Ruby.
libpng is already installed on my PowerBook... Presumably, it comes with Mac OS X. Just link to it with -lpng.
- Alex Diener
- Alex Diener
hi,
The make still fails with the -lpng ld option.
~/Game_Dev/png_lib] mnorton% make
g++ -framework GLUT -framework OpenGL -Wall -o pngExample -L"/System/Library/Frameworks/OpenGL.framework/Libraries" pngExample.o -lpng -lGL -lGLU -lm -lobjc -lstdc++
ld: can't locate file for: -lpng
make: *** [pngExample] Error 1
### Here is my makefile###
~/Game_Dev/png_lib] mnorton% more makefile
LIBDIR += -L"/System/Library/Frameworks/OpenGL.framework/Libraries"
FRAMEWORK = -framework GLUT
FRAMEWORK += -framework OpenGL
COMPILERFLAGS = -Wall
CC = g++
CFLAGS = $(COMPILERFLAGS)
LIBRARIES = -lpng -lGL -lGLU -lm -lobjc -lstdc++
OBJECTS = pngExample.o
All: pngExample
pngExample: pngExample.o $(OBJECTS)
$(CC) $(FRAMEWORK) $(CFLAGS) -o $@ $(LIBDIR) $(OBJECTS) $(LIBRARIES)
./pngExample
### here is more info on the location of my png file ###
~/Game_Dev/png_lib] mnorton% ls /usr/local/lib
ls: /usr/local/lib: No such file or directory
[Michael-Nortons-Computer:~/Game_Dev/png_lib] mnorton% ls /usr/lib/libpng*
ls: No match.
~/Game_Dev/png_lib] mnorton% ls /sw/lib/libpng*
/sw/lib/libpng.3.1.2.5.dylib /sw/lib/libpng12.0.1.2.5.dylib
/sw/lib/libpng.3.dylib /sw/lib/libpng12.0.dylib
Any ideas on how to make this work?
thanks,
Mike
The make still fails with the -lpng ld option.
~/Game_Dev/png_lib] mnorton% make
g++ -framework GLUT -framework OpenGL -Wall -o pngExample -L"/System/Library/Frameworks/OpenGL.framework/Libraries" pngExample.o -lpng -lGL -lGLU -lm -lobjc -lstdc++
ld: can't locate file for: -lpng
make: *** [pngExample] Error 1
### Here is my makefile###
~/Game_Dev/png_lib] mnorton% more makefile
LIBDIR += -L"/System/Library/Frameworks/OpenGL.framework/Libraries"
FRAMEWORK = -framework GLUT
FRAMEWORK += -framework OpenGL
COMPILERFLAGS = -Wall
CC = g++
CFLAGS = $(COMPILERFLAGS)
LIBRARIES = -lpng -lGL -lGLU -lm -lobjc -lstdc++
OBJECTS = pngExample.o
All: pngExample
pngExample: pngExample.o $(OBJECTS)
$(CC) $(FRAMEWORK) $(CFLAGS) -o $@ $(LIBDIR) $(OBJECTS) $(LIBRARIES)
./pngExample
### here is more info on the location of my png file ###
~/Game_Dev/png_lib] mnorton% ls /usr/local/lib
ls: /usr/local/lib: No such file or directory
[Michael-Nortons-Computer:~/Game_Dev/png_lib] mnorton% ls /usr/lib/libpng*
ls: No match.
~/Game_Dev/png_lib] mnorton% ls /sw/lib/libpng*
/sw/lib/libpng.3.1.2.5.dylib /sw/lib/libpng12.0.1.2.5.dylib
/sw/lib/libpng.3.dylib /sw/lib/libpng12.0.dylib
Any ideas on how to make this work?
thanks,
Mike
your link flags should include
Code:
-L/sw/lib -lpng -lz
hi,
Thanks. That worked. Also, I had to install libpng from fink. Apparently, libpng wasn't installed in either /usr/lib or /sw/lib. The libs I pointed out above weren't libpng.
-or THE libpng - I should say.
ls libpng*
libpng.2.1.0.12.dylib libpng.a libpng12.a
libpng.2.dylib libpng.dylib libpng12.dylib
libpng.3.1.2.5.dylib libpng12.0.1.2.5.dylib
libpng.3.dylib libpng12.0.dylib
Once I installed libpng from fink commander -all was happy.
thanks a million!
Mike
Thanks. That worked. Also, I had to install libpng from fink. Apparently, libpng wasn't installed in either /usr/lib or /sw/lib. The libs I pointed out above weren't libpng.
-or THE libpng - I should say.
ls libpng*
libpng.2.1.0.12.dylib libpng.a libpng12.a
libpng.2.dylib libpng.dylib libpng12.dylib
libpng.3.1.2.5.dylib libpng12.0.1.2.5.dylib
libpng.3.dylib libpng12.0.dylib
Once I installed libpng from fink commander -all was happy.
thanks a million!
Mike
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| libpng loading junk at bottom of my OpenGL textures...? | BinarySpike | 6 | 5,039 |
Apr 19, 2007 12:20 PM Last Post: BinarySpike |
|
| libpng transparency problem | wyrmmage | 3 | 4,238 |
Mar 1, 2007 05:53 PM Last Post: OneSadCookie |
|
| libPng And Memory Access Violations | Jaden | 8 | 7,255 |
Feb 23, 2007 11:01 PM Last Post: AnotherJake |
|
| Trouble writing PNGs with 16 bits per channel using libpng | flash | 2 | 2,845 |
Aug 28, 2006 11:01 AM Last Post: flash |
|
| libpng with OpenGL : return what? | Jones | 3 | 3,469 |
May 28, 2006 07:32 AM Last Post: Jones |
|

