[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] segmentation fault when linking with newt
From: |
Christophe Staïesse |
Subject: |
Re: [Tinycc-devel] segmentation fault when linking with newt |
Date: |
Tue, 7 Jul 2015 06:23:37 +0200 |
Hi,
This is due to a bug in your program: the last component in the call of
newtOpenWindow() should be followed by NULL.
Christophe.
On Mon, 06 Jul 2015 10:20:46 -0500
address@hidden (Andrés Ramírez) wrote:
> Hi guys.
>
> I am trying this simple example (which fails on the line with
> newtFormAddComponents):
>
> #include <newt.h>
> #include <stdio.h>
> #include <stdlib.h>
> /* tcc -g -o button.bin button.c -lnewt */
> /* gdb --annotate=3 -i=mi --args button.bin */
> void main(void) {
> int left, top, width, height;
>
> newtComponent form, b1, b2, b3, b4, bback;
> newtInit();
> newtCls();
>
> left = 10;
> top = 5;
> width = 40;
> height = 10;
> newtOpenWindow(left, top, width, height, "Shell Buttons");
>
> b1 = newtCompactButton(left, 1, "Uno");
> b2 = newtCompactButton(left, 2, "Dos");
> b3 = newtCompactButton(left, 3, "Tres");
> b4 = newtCompactButton(left, 4, "Cuatro");
> bback = newtButton(left, 6, "Back");
> form = newtForm(NULL, NULL, 0);
> /* newtFormAddComponents fails with tcc */
> newtFormAddComponents(form, b1, b2, b3, b4, bback);
>
> newtRunForm(form);
>
> newtFormDestroy(form);
> newtFinished();
> }
>
>
> Let me know. If You need any other info. Best Regards
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel