How to use AAlib with C or C++?
How can I use the ascii art library aalib with c or c++ code.
There is no concrete example. INFO programe explains few lines of code but I could not understand as this is not a complete example. I want to write a c code that will open an image file and convert it to an ascii image art. I think it is possible with aalib as it is written specially for this purpose. I have come to know what header file is required and what the linker flag (-laa) but I need to know at least a simple complete example. Thank you. |
|
Where is the example/sample programme?
Please don't post anything irresponsibly only for the shake of posting something. It would be really helpful if you pointed out the specific example as I couldn't find the solution. |
Sorry I can't understand what you can't find. That page has many examples, no? The stuff is really old, and I now see many links don't work. But, many do, and I think they're complete. And 2 clicks away, on the first link on each page, you end up here:
http://aa-project.sourceforge.net/aalib/aalib_toc.html I can't remember exactly, but I think you asked for examples and documentation for aalib no? Now I see you have edited it, so I'm not really sure what I answered. :) Also, another way is to search your distro for examples. Here's from my Ubuntu: Quote:
|
Thank you for your reply and please let me clear the amibiguity at my end.
I edited just one word. I changed (-laalib) to (-laa) as -laalib is the wrong flag and I mistakenly wrote -laalib. I wanted to say in my first message(2nd line); "INFO programe explains few lines of code but I could not understand... ." The 'info aalib' contains the same material as that of the link you have given here but my problem is that I can't understand how to begin. I successfully compiled the following code which opens a blank window and terminates it. Quote:
(in /usr/local/info/info.aalib-1) with $ gcc -Wall -W -O -g3 -o aalibprog aalibprog.c -laa Quote:
but getting the following error; aalibprog.c: In function 'main': aalibprog.c:29:20: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] aalibprog.c:36:58: error: macro "aa_setpalette" requires 5 arguments, but only 4 given aalibprog.c:34:10: error: 'aa_setpalette' undeclared (first use in this function) aalibprog.c:34:10: note: each undeclared identifier is reported only once for each function it appears in aalibprog.c:39:73: error: macro "aa_putpixel" requires 4 arguments, but only 3 given aalibprog.c:39:8: warning: statement with no effect [-Wunused-value] aalibprog.c:45:32: error: incompatible type for argument 3 of 'aa_renderpalette' In file included from aalibprog.c:1:0: /usr/local/include/aalib.h:647:6: note: expected 'const struct aa_renderparams *' but argument is of type 'struct aa_renderparams' aalibprog.c:11:14: warning: variable 'framebuffer' set but not used [-Wunused-but-set-variable] so I've asked for the help. Thanks again. |
All times are GMT -5. The time now is 07:32 PM. |