I tried a bunch of the stuff in that email didn't seem to get me past the
point I'm at. I'm going to try to give a better idea of the situation since
I'm pretty sure it's something small I'm overlooking.
Files in the directory I'm building in:
Makefile libpngwriter.a pngwriter.h tile.o
map.dat mapgen.o tile.cc
mapgen.cc tile.h
Makefile:
OBJS = mapgen.o tile.o libpngwriter.a
CXX = g++
DEBUG = -g
CFLAGS = -Wall -c -DNO_FREETYPE -lpng $(DEBUG)
LFLAGS = -Wall $(DEBUG)
mapgen: $(OBJS)
$(CXX) $(LFLAGS) $(OBJS) -o mapgen
mapgen.o: mapgen.cc
$(CXX) $(CFLAGS) mapgen.cc
tile.o: tile.h tile.cc
$(CXX) $(CFLAGS) tile.cc
default: mapgen
main: mapgen
all: mapgen
clean:
@rm -f *.o *~ mapgen
Make gives me these error(only showing first bunch of lines(about 50 lines
like theses))
g++ -Wall -g mapgen.o tile.o libpngwriter.a -o mapgen
Undefined first referenced
symbol in file
png_init_io libpngwriter.a(pngwriter.o)
png_read_info libpngwriter.a(pngwriter.o)
png_set_expand libpngwriter.a(pngwriter.o)
png_convert_from_time_t libpngwriter.a(pngwriter.o)
png_get_rowbytes libpngwriter.a(pngwriter.o)
png_destroy_read_struct libpngwriter.a(pngwriter.o)
.....
Hopefully that helps.
Note I did try your suggestions, but never got farther then this(hence none
of the suggestions are in my Makefile)
Sorry to make such a long email
-Chris
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of individual
Sent: Saturday, November 06, 2004 6:37 PM
To: [EMAIL PROTECTED]
Subject: [PNGwriter-users] Re: Compiling PNGWriter
Hi Chris,
In your original Forum post you said that you had "libpng and pngwriter
compiling". Now you say that you cannot get it to compile.
If you cannot get PNGwriter to compile, then please copy and paste the
compiler output here so I can have a look at it.
If you have compiled PNGwriter, but cannot install it, please edit
make.include and change the line that says
DESTDIR=/usr/local
to
DESTDIR=/nnn/xxx
where /nnn/xxx is wherever you want to put the library. One suggestion
is:
DESTDIR=/home/youruser/usr/local
Then, add the compiler flags -L/home/youruser/usr/local/lib and
-I/home/youruser/usr/local/include to the compilation arguments of
whatever project you compile that uses PNGwriter, in addition to the
arguments specified in the example in the PNGwriter Manual PDF.
If you have compiled PNGwriter, installed it, but cannot figure out
what arguments to give g++ to compile your project, please read the
Compilation section of the PNGwriter Manual PDF.
Here is a section taken from the Makefile in the examples/ directory of
the PNGwriter package. It should tell you the basics of what you need
to know about compiling something. Please note that this was written
before PNGwriter became a library (mental note, must change this), but
the basics of what it explainns are valid.
Just to clear things up, the recommended procedure to use PNGwriter is:
Compile and install libpngwriter, either system-wide, the default, or
in a director you own.
Write your program, create a Makefile for it, and use the example
compilation arguments given in the Manual. If you installed
libpngwriter somewhere non-standard, then just add these compiler
arguments as shown above.
Best of luck
Paul
# MAKEFILE BASICS
# What do the compiler flags that are used here mean?
#
# -O3 (dash-oh-three). Code optimization. 1 is slight, 3 is max.
#
# -o "What you output, output with this filename".
#
# -c Compile the code, but don't link. Think of this as the instruction
given
# to a carpenter who has made the parts to make a chair. He is told
with this
# flag that he must not glue the chair together yet. The seat of the
chair is
# useless by itself, it needs to be glued to the other parts of the
chair to
# be useful. -c will make an object file, and this is what we want to
do with
# PNGwriter, by creating pngwriter.o. This is like making a leg of a
chair
# (the whole chair is your entire program) and we'll leave it ready for
when
# your chair is ready for gluing (compiling and linking the final
program).
# The advantage of this approach is, that if you need to re-do a part
of the
# chair, you dont have to make (compile) the legs of the chair all over
again.
# You can even take the object file (pngwriter.o) once it is compiled
and use
# it in another project (remember to take the pngwriter.h file as well!)
#
# -I (uppercase i). If you, like me, have a few header files installed
in a
# non-standard place, then say where with this option.
#
# -L The same, but for libraries.
#
# -l (lowecase L). To use a library. For libpng, use -lpng. For Zlib,
use
# -lz. For pngwriter, use -lpngwriter.
#
#
########################################################################
###############
> From: Chris Gagnon <[EMAIL PROTECTED]>
> Compiling PNGWriter �
> 2004-11-06 18:37
> As requested, I will continue with a question I posted in the forums
> on this
> list.
>
>
>
> I am attempting to use the pngwritter and I cannot get it to compile.
>
>
>
> I would guess that the reason I cannot is because I cannot actually
> install
> the package.
>
> I can get it to compile since libpng is installed on the server.
>
> But due to permissions I can"t install it.
>
>
>
> I"m not the greatest with Makefile"s and am looking for some help
> somehow
> telling it where to find the library file correctly.
>
>
>
> Please include what files I need where and as much information as you
> can(within reason of course, so I can make sure I have it all setup
> right)
>
>
>
> Thx,
>
> Chris
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=ick
_______________________________________________
http://pngwriter.sourceforge.net/
PNGwriter-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pngwriter-users
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
_______________________________________________
http://pngwriter.sourceforge.net/
PNGwriter-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/pngwriter-users