Can't build on Ubuntu 5.04 Hoary Hedgehog

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
zimmerpflanze
Posts: 4
Joined: Tue Jul 05, 2005 7:17 am
Contact:

Can't build on Ubuntu 5.04 Hoary Hedgehog

Post by zimmerpflanze »

Hi!
Just read about this nice little program on BoingBoing and I just had to get hold of it!

So I downloaded it, read the README.txt, installed g++ and flex (think it automatically installed bison) via apt-get and then downloaded and successfully installe zlib and libpng.

After that I tried to run "make" for CFDG... Didnt work! This is my output:

Code: Select all

g++  -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -O3  -c -o objs/pngCanvas.o src-unix/pngCanvas.cpp
src-unix/pngCanvas.cpp:2:17: png.h: Datei oder Verzeichnis nicht gefunden
src-unix/pngCanvas.cpp:51: error: `png_structp' was not declared in this scope
src-unix/pngCanvas.cpp:51: error: Fehler beim Parsen before `,' token
src-unix/pngCanvas.cpp: In function `void <unnamed>::pngWriteError(...)':
src-unix/pngCanvas.cpp:53: error: `message' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:53: error: (Each undeclared identifier is reported only
   once for each function it appears in.)
src-unix/pngCanvas.cpp: At global scope:
src-unix/pngCanvas.cpp:58: error: `png_structp' was not declared in this scope
src-unix/pngCanvas.cpp:58: error: Fehler beim Parsen before `,' token
src-unix/pngCanvas.cpp: In member function `void pngCanvas::output(const char*)
   ':
src-unix/pngCanvas.cpp:71: error: `png_structp' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:71: error: Fehler beim Parsen before `=' token
src-unix/pngCanvas.cpp:72: error: `png_infop' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:75: error: `png_ptr' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:76: error: `PNG_LIBPNG_VER_STRING' undeclared (first use
   this function)
src-unix/pngCanvas.cpp:77: error: `png_create_write_struct' undeclared (first
   use this function)
src-unix/pngCanvas.cpp:80: error: Fehler beim Parsen before `=' token
src-unix/pngCanvas.cpp:81: error: `info_ptr' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:89: error: `png_init_io' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:92: error: `PNG_COLOR_TYPE_GRAY' undeclared (first use
   this function)
src-unix/pngCanvas.cpp:93: error: `PNG_INTERLACE_NONE' undeclared (first use
   this function)
src-unix/pngCanvas.cpp:93: error: `PNG_COMPRESSION_TYPE_DEFAULT' undeclared
   (first use this function)
src-unix/pngCanvas.cpp:94: error: `PNG_FILTER_TYPE_DEFAULT' undeclared (first
   use this function)
src-unix/pngCanvas.cpp:94: error: `png_set_IHDR' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:96: error: `png_text' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:96: error: Fehler beim Parsen before `[' token
src-unix/pngCanvas.cpp:97: error: `comments' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:98: error: `PNG_TEXT_COMPRESSION_NONE' undeclared (first
   use this function)
src-unix/pngCanvas.cpp:103: error: `png_set_text' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:105: error: `png_write_info' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:107: error: `png_bytep' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:107: error: Fehler beim Parsen before `=' token
src-unix/pngCanvas.cpp:109: error: `rowPtr' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:109: error: `png_write_row' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:113: error: `png_write_end' undeclared (first use this
   function)
src-unix/pngCanvas.cpp:124: error: `png_destroy_write_struct' undeclared (first
   use this function)
make: *** [objs/pngCanvas.o] Fehler 1
Du you know any way out of this?
Thanks in advance!
All in all is all we are

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

looks like an include path problem

Post by MtnViewJohn »

The makefile doesn't try to locate the libpng include file. It assumes that libpng was installed somewhere where the compiler will automatically find it. You could find where the libpng include files are stored and add that directory to the line:

INC_DIRS = $(COMMON_DIR) $(UNIX_DIR) $(DERIVED_DIR) $(AGG_DIR)/include

in the makefile.

Guest

Post by Guest »

I had the same problem. I fixed it by installing libpng12-dev.

zimmerpflanze
Posts: 4
Joined: Tue Jul 05, 2005 7:17 am
Contact:

Post by zimmerpflanze »

Thanks to both of you... The firs hint didn't work out for me, as I was unable/to stupid to locate the include-paths... Searched anything with locate and by hand but found nothing, so I just added the main paths of libpng in the described way - didn't help. But the second one worked out just fine - at least up to the point, where yacc enters the arena. My Ubuntu install doesnt know it (what the heck is included with this distro?), so I'll search for it and install it... Hopefully;)
All in all is all we are

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

I will update the documentation to clarify that the libpng development package needs to be installed. It is not enough to install the libpng runtime package. That is why you couldn't find the includes: they weren't present on your system. Sorry.

zimmerpflanze
Posts: 4
Joined: Tue Jul 05, 2005 7:17 am
Contact:

Another problem: This time with yacc

Post by zimmerpflanze »

Doesn't matter... But its good to know that I didnt fail in finding them due to my stupidity, but due to their absence;)

The aforementioned problem with yacc could be solved, by the way... Just installed the package byacc and yacc could be found. But this did'nt help that much. Now I get the following output:

Code: Select all

yacc -d -o objs/y.tab.c src-common/cfdg.y
usage: yacc [-dlrtv] [-b file_prefix] [-p symbol_prefix] filename
make: *** [objs/y.tab.c] Fehler 1
All in all is all we are

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

The very latest version of BYACC supports the -o command line option. But the feature was added in May of this year so your distro may not have it packaged up yet. We should probably tweak the Makefile to remove the dependency on support for the -o option.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Replacing the yacc build line in the Makefile with this seems to fix it:

Code: Select all

	cd $(DERIVED_DIR); yacc -d ../$(COMMON_DIR)/cfdg.y
I should change that in the next release.

zimmerpflanze
Posts: 4
Joined: Tue Jul 05, 2005 7:17 am
Contact:

Post by zimmerpflanze »

Now it works just fine... Thanks for your great support and your patience!
All in all is all we are

Post Reply