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:
#include <stdio.h>
#include <aalib.h>
aa_context *context;
int main()
{
context = aa_autoinit(&aa_defparams);
if(context == NULL) {
fprintf(stderr,"Cannot initialize AA-lib. Sorry\n");
exit(1);
}
aa_close(context);
}
|
and when I try to compile another aalib code
(in /usr/local/info/info.aalib-1) with
$ gcc -Wall -W -O -g3 -o aalibprog aalibprog.c -laa
Quote:
#include <aalib.h>
#include <stdlib.h>
int
main (int argc, char **argv)
{
int i;
aa_context *context; /* The information about currently
initialized device. */
aa_palette palette; /* Emulatted palette (optional) */
char *framebuffer;
/* Parse command line options and output the help text. */
if (!aa_parseoptions (NULL, NULL, &argc, argv) || argc != 1)
{
printf ("%s", aa_help);
exit (1);
}
/* Initialize output driver. */
context = aa_autoinit (&aa_defparams);
if (context == NULL)
{
printf ("Failed to initialize aalib\n");
exit (1);
}
/* Pointer to the emulated videoram. */
framebuffer = aa_image (context);
/* Create palette if needed: */
for (i = 0; i < 256; i++)
aa_setpalette (palette, i /* R value 0..255 */ ,
/* G value 0..255 */ ,
/* B value 0..255 */ );
/* Draw something using: */
aa_putpixel (context /* X coord */ , /* Y coord */ , /* Color */ );
/* Render whole screen: */
aa_renderpalette (context, palette, aa_defrenderparams,
/* Top left conner of rendered area: */ 0, 0,
/* Bottom right */ aa_scrwidth (context), aa_scrheight (context));
/* If you don't use palette use following function:
aa_render (context, aa_defrenderparams,
0, 0, aa_scrwidth (context), aa_scrheight (context));
*/
/* And make it visible: */
aa_flush (context);
/* And uninitialize the AA_lib (this probably makes the picture invisible
again) */
aa_close (context);
return 1;
}
|
getting the following error:
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.