Nuta | 3 May 2013 03:58
Picon
Favicon

Can't get agar-helloworld app to work. (application error 0xc000007b)

Hello there!

I'm trying to get to work agar-helloworld program to work. It compiles with
some warnings:

1>------ Rebuild All started: Project: agar test 2, Configuration: Debug
Win32 ------
1>  main.cpp
1>c:\program files (x86)\microsoft visual studio
10.0\vc\include\wchar.h(474): warning C4091: 'typedef ' : ignored on left of
'__int64' when no variable is declared
1>     Creating library C:\Users\Nuta\Desktop\agar test 2\Debug\agar test
2.lib and object C:\Users\Nuta\Desktop\agar test 2\Debug\agar test 2.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
libs; use /NODEFAULTLIB:library
1>     Creating library C:\Users\Nuta\Desktop\agar test 2\Debug\agar test
2.lib and object C:\Users\Nuta\Desktop\agar test 2\Debug\agar test 2.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other
libs; use /NODEFAULTLIB:library
1>  agar test 2.vcxproj -> C:\Users\Nuta\Desktop\agar test 2\Debug\agar test
2.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Tho, in the end it succeeds, as you can see in compilation log. The problem
occurs, when I try to run it. Immediately after I do so, alert popups
(translated to english from polish):
(Continue reading)

Ritvik_Sharma | 22 Jan 2013 09:22
Picon
Favicon

Agar Digest, Vol 44, Issue 1

Hi all, 

Can you please tell how does Agar integrates OpenGl?  AGAR already exists in the UEFI environment. I want to
port OpenGL such that it is integrated as a part of Agar. 

Thanks 
Ritvik 

-----Original Message-----
>From: agar-bounces@...
[mailto:agar-bounces@...] On Behalf Of agar-request@...
Sent: Thursday, January 17, 2013 1:30 PM
To: agar@...
Subject: Agar Digest, Vol 44, Issue 1

Send Agar mailing list submissions to
	agar@...

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail231.csoft.net/mailman/listinfo/agar
or, via email, send a message with subject or body 'help' to
	agar-request@...

You can reach the person managing the list at
	agar-owner@...

When replying, please edit your Subject line so it is more specific than "Re: Contents of Agar digest..."

Today's Topics:

(Continue reading)

Gustav Johansson | 7 Jan 2013 08:10

Need help to compile Ada-bindings on FreeBSD

Hi,

I'm trying to install libagar with Ada-bindings on a FreeBSD-9.1
machine. The library itself compiles and installs according to
instructions without a hitch. The Ada-bindings are a different matter
though.

As far as I can gather from the README files, I should download and
install AdaSDL first, which I have done. The next step seems to be to
run "make" in the ada-core folder, and this is where I get stuck...

<snip>
[~/sources/agar-1.4.1/ada-core] # make
.../check-deps
check-deps: error: C_String (http://coreland.ath.cx/code/c_string)
required but not located
check-deps: error: SYSDEPS module c_string-flags, file flags-c_string
check-deps: error: C_String (http://coreland.ath.cx/code/c_string)
required but not located
check-deps: error: SYSDEPS module c_string-libs-S, file libs-c_string-S
check-deps: info: See the documentation on SYSDEPS if you do not
understand how to fix this problem
check-deps: info: http://coreland.ath.cx/code/sysdeps
*** [local] Error code 1
Stop in /root/sources/agar-1.4.1/ada-core.
<end snip>

I have no idea what this error means since I have never used "SYSDEPS"
before, and unfortunately the web-address that is referred to for
instructions seems to be out. There is no server on the net called
(Continue reading)

Ritvik_Sharma | 6 Jan 2013 14:07
Picon
Favicon

AGAR support for OpenGL in UEFI

Hi All,

 

Can you please tell does AGAR library support OpenGL implementation in UEFI environment? If not is it feasible to achieve the same?

 

Thanks

Ritvik

_______________________________________________
Agar mailing list
Agar@...
http://libagar.org/lists.html
Ben Collver | 2 Dec 2012 04:13
Picon

textbox scrollbars

Good day,

Attached is an example program that shows its own source code in a 
textbox.  Also attached is a screenshot of the program output.  I am 
using Agar SVN on Linux with SDL.  I expected a vertical scrollbar, but 
there is none.  The horizontal scrollbar is visible.  I expected the 
text to scroll horizontally, but it remains fixed when I move the 
horizontal scrollbar.  Do you know of a working example that uses the 
scrollbars in a textbox widget?

Thank you,

-Ben
/*
cc $(agar-config --cflags) -I/home/ben/local/include -L/home/ben/local/lib
-Wl,-R/home/ben/local/lib $(agar-config --libs) problem.c
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <agar/core.h>
#include <agar/gui.h>

void quitter(AG_Event *event) {
    AG_QuitGUI();
    return;
}

int main(int argc, char *argv[]) {
    int result;
    AG_Box *box,
        *box2;
    AG_Button *exitbutton;
    AG_Textbox *tb;
    AG_Window *win;
    FILE *fp;
    char buffer[4096];

    result = AG_InitCore("problem", 0);
    if (result == -1) {
        puts(AG_GetError());
        exit(1);
    }

    result = AG_InitGraphics("sdlfb(width=800:height=600:depth=32)");
    if (result == -1) {
        puts(AG_GetError());
        exit(1);
    }
    win = AG_WindowNew(AG_WINDOW_PLAIN);
    AG_WindowSetCaptionS(win, "Example window caption");
    AG_WindowSetPosition(win, AG_WINDOW_MC, 1);
    AG_WindowSetGeometryMax(win);

    box = AG_BoxNew(win, AG_BOX_VERT, AG_BOX_EXPAND);
    AG_BoxSetLabelS(box, "Example box title");

    memset(buffer, 0, 4096);
    fp = fopen("problem.c", "r");
    fread(buffer, 1, 4096, fp);
    fclose(fp);
    buffer[4095] = '\000';

    tb = AG_TextboxNewS(box, AG_TEXTBOX_EXCL | AG_TEXTBOX_MULTILINE, buffer);
    AG_EditableSizeHint(
        tb->ed,
        "                                        "
        "                                        "
        "                                        "
        "                                        "
    );
    AG_EditableSizeHintLines(tb->ed, 24);

    box2 = AG_BoxNew(box, AG_BOX_HORIZ, AG_BOX_EXPAND);
    AG_BoxSetHorizAlign(box2, AG_BOX_CENTER);

    exitbutton = AG_ButtonNewS(box2, 0, "Exit");
    AG_AddEvent(exitbutton, "button-pushed", quitter, NULL);

    AG_WindowShow(win);
    AG_EventLoop();
    AG_QuitGUI();
    exit(0);
}
_______________________________________________
Agar mailing list
Agar@...
http://libagar.org/lists.html
Philip | 29 Nov 2012 05:48
Picon

Agar 1.4 doesn't compile / Agar trunk doesn't run

I stumbled upon Agar yesterday, and from the description and screenshots I think 
it is exactly what I have been looking for. However, so far I have been unable 
to do anything with it.
Agar 1.4.1 won't build (linux x86_64/gcc 4.6.3), make depend runs fine, but make 
all fails with the following errors:

In file included from core.h:12:0,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/threads.h:28,
                 from core.h:20,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/core_init.h:5,
                 from core.h:49,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/error.h:11,
                 from core.h:50,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/string_compat.h:60,
                 from core.h:54,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/vasprintf.h:8,
                 from core.h:57,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/data_source.h:5,
                 from core.h:78,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/byteswap.h:11,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/load_integral.h:33,
                 from core.h:79,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/load_integral.h:35,
                 from core.h:79,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/load_real.h:12,
                 from core.h:80,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/load_string.h:8,
                 from core.h:81,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/load_version.h:5,
                 from core.h:82,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/version.h:5,
                 from core.h:84,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/timeout.h:3,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/object.h:17,
                 from core.h:85,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/class.h:3,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/object.h:18,
                 from core.h:85,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/object.h:20,
                 from core.h:85,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/variable.h:3,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/object.h:281,
                 from core.h:85,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/event.h:3,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/object.h:282,
                 from core.h:85,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/prop.h:6,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/object.h:283,
                 from core.h:85,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/list.h:8,
                 from core.h:86,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/tree.h:39,
                 from core.h:87,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/tbl.h:8,
                 from core.h:88,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/cpuinfo.h:5,
                 from core.h:89,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/file.h:5,
                 from core.h:90,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/dir.h:5,
                 from core.h:91,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/dso.h:5,
                 from core.h:92,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/time.h:3,
                 from core.h:93,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-1.4.1/include/agar/core/db.h:5,
                 from core.h:94,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/dbobject.h:5,
                 from core.h:95,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
In file included from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/begin.h:8:0,
                 from /home/prushik/Sandbox/agar-
1.4.1/include/agar/core/exec.h:5,
                 from core.h:96,
                 from variable.c:26:
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: error: 
redefinition of 'struct ag_fake_int64'
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: note: 
originally defined here
/home/prushik/Sandbox/agar-1.4.1/include/agar/core/types.h:103:16: warning: 
useless storage class specifier in empty declaration [enabled by default]
make[2]: *** [variable.lo] Error 1
make[2]: Leaving directory `/home/prushik/Sandbox/agar-1.4.1/core'
make: failure
make[1]: *** [_lib_shobjs] Error 1
make[1]: Leaving directory `/home/prushik/Sandbox/agar-1.4.1/core'
make: *** [all-subdir] Error 1

Agar trunk (from SVN) builds and installs fine with no problems.
however, linking applications with it does not work well, configure scripts 
report that agar does not work
checking for Agar (http://libagar.org/)...yes (1.5.0)
checking whether Agar works...no
* 
* This software requires agar installed on your system.
* 
configure failed!

Manually compiling and linking is successful, as long as I use agar-config and 
NOT agar-core-config. I also need to link with libdl.
"gcc -o hello hello.c -I/usr/local/include/agar/ `agar-core-config --libs --
cflags` -ldl"
fails with the following messages:

/tmp/cchMYn49.o:hello.c:function AG_EventLoop: error: undefined reference to 
'agDriverSw'
/tmp/cchMYn49.o:hello.c:function AG_EventLoop: error: undefined reference to 
'agDriverSw'
/tmp/cchMYn49.o:hello.c:function AG_EventLoop: error: undefined reference to 
'agDriverSw'
/tmp/cchMYn49.o:hello.c:function AG_EventLoop: error: undefined reference to 
'agDriverOps'
/tmp/cchMYn49.o:hello.c:function AG_EventLoop: error: undefined reference to 
'agDriverSw'
/tmp/cchMYn49.o:hello.c:function main: error: undefined reference to 
'AG_InitGraphics'
/tmp/cchMYn49.o:hello.c:function main: error: undefined reference to 
'AG_WindowNew'
/tmp/cchMYn49.o:hello.c:function main: error: undefined reference to 
'AG_LabelNew'
/tmp/cchMYn49.o:hello.c:function main: error: undefined reference to 
'AG_WindowShow'
collect2: ld returned 1 exit status

and "gcc -o hello hello.c -I/usr/local/include/agar/ `agar-config --libs --
cflags` -ldl"
compiles and links successfully, however, the resulting executable fails to run 
with the following message:

../hello: symbol lookup error: /usr/local/lib/libag_gui.so.5: undefined symbol: 
jpeg_resync_to_restart

Any idea what I can do to get agar working?
Sean Ulrich | 11 Nov 2012 16:35
Picon

Agar 1.4.1 on Debian Squeeze VM

I appreciate all your work putting this together.  It looks very impressive.

Like the previous post from Josh Branning 
(http://thread.gmane.org/gmane.comp.lib.agar.general/675), I am attempting to 
install Agar 1.4.1 on Debian Squeeze and am having trouble.  But, unlike Josh, I 
have the added variable of running Debian in a VirtualBox VM.  Here is what I've 
done:

I downloaded the 1.4.1 tarball and unzipped to ~/agar-1.4.1
>From there, I ran "./configure --enable-debug", "make depend all", "sudo make 
install", and "sudo ldconfig".  Everything seems to install correctly.  I then 
made the hello.c from the website and it compiled successfully with "gcc -o 
hello `agar-config --cflags` -g hello.c `agar-config --libs`"

However, when I run "./hello" I get Segmentation Fault.  Checking gdb shows:

Program received signal SIGSEGV, Segmentation fault.
0xb7b991a0 in ?? () from /lib/i686/cmov/libc.so.6
(gdb) backtrace
#0  0xb7b991a0 in ?? () from /lib/i686/cmov/libc.so.6
#1  0xb7ed116a in AG_TryStrdup () from /usr/local/lib/libag_core.so.4
#2  0xb7eba55f in AG_InitCore () from /usr/local/lib/libag_core.so.4
#3  0x080486e1 in main (argc=1, argv=0xbffff4e4 "L\366\377\277") at hello.c:7

If it's helpful, if I run "sudo ./hello" I do not get the Segmentation Fault.  
However nothing happens.

Should I try an alternate configuration?  I appreciate the help.

______Below is is my config.log____

Generated by configure script
BSDBuild Version: 2.8
Host: i686-pc-linux-gnu
Argument: --enable-debug
checking for a C compiler...yes, /usr/bin/cc
checking whether the C compiler works...yes
checking for compiler warning options.../usr/bin/cc   -Wall -Werror -o 
../conftest conftest.c 
yes
checking for gcc.../usr/bin/cc  -Wall -Werror  -o ./conftest conftest.c 
yes
checking for IEEE754 floating point.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c 
yes
checking aligned attribute.../usr/bin/cc  -Wall -Werror -Wall -Werror -o 
../conftest conftest.c
yes
checking bounded attribute.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c 
cc1: warnings being treated as errors
conftest.c:1: error: ‘__bounded__’ attribute directive ignored
-> failed (0)
no
checking const attribute.../usr/bin/cc  -Wall -Werror  -o ./conftest conftest.c
yes
checking deprecated attribute.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c
yes
checking format attribute.../usr/bin/cc  -Wall -Werror  -o ./conftest conftest.c 
yes
checking nonnull attribute.../usr/bin/cc  -Wall -Werror -Wall -Werror -o 
../conftest conftest.c
yes
checking noreturn attribute.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c
yes
checking packed attribute.../usr/bin/cc  -Wall -Werror -Wall -Werror -o 
../conftest conftest.c
yes
checking pure attribute.../usr/bin/cc  -Wall -Werror  -o ./conftest conftest.c
yes
checking warn_unused_result attribute.../usr/bin/cc  -Wall -Werror  -o 
../conftest conftest.c
yes
checking for long double.../usr/bin/cc  -Wall -Werror -o ./conftest conftest.c
yes
checking for long long.../usr/bin/cc  -Wall -Werror -o ./conftest conftest.c
yes
checking for cygwin environment.../usr/bin/cc  -Wall -Werror -mcygwin -o 
../conftest conftest.c
cc1: error: unrecognized command line option "-mcygwin"
-> failed (0)
no
checking for <sys/types.h>.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c 
yes
checking for 64-bit types.../usr/bin/cc  -Wall -Werror  -o ./conftest conftest.c 
yes
checking for conflicting typedefs.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c 
conftest.c: In function ‘main’:
conftest.c:3: error: ‘Uchar’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
conftest.c:3: error: expected ‘;’ before ‘foo’
conftest.c:4: error: ‘Uint’ undeclared (first use in this function)
conftest.c:4: error: expected ‘;’ before ‘bar’
conftest.c:5: error: ‘Ulong’ undeclared (first use in this function)
conftest.c:5: error: expected ‘;’ before ‘baz’
conftest.c:6: error: ‘foo’ undeclared (first use in this function)
conftest.c:6: error: ‘bar’ undeclared (first use in this function)
conftest.c:6: error: ‘baz’ undeclared (first use in this function)
-> failed (0)
no
checking for <stdlib.h>.../usr/bin/cc  -Wall -Werror  -o ./conftest conftest.c 
yes
checking for <unistd.h>.../usr/bin/cc  -Wall -Werror  -o ./conftest conftest.c 
yes
checking for compatible <limits.h>.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c 
yes
checking for compatible <float.h>.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c 
yes
checking for the __progname variable.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for the C math library.../usr/bin/cc  -Wall -Werror   -o ./conftest 
conftest.c -lm
yes
checking for the C math library (C99).../usr/bin/cc  -Wall -Werror   -o 
../conftest conftest.c -lm
yes
checking for a getpwuid() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for a getuid() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for a strsep() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
cc1: warnings being treated as errors
conftest.c: In function ‘main’:
conftest.c:5: error: null argument where non-null required (argument 1)
conftest.c:5: error: null argument where non-null required (argument 2)
-> failed (0)
no
checking for the snprintf() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for the vsnprintf() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for a vasprintf() function.../usr/bin/cc  -Wall -Werror -D_GNU_SOURCE -
o ./conftest conftest.c
yes
checking for the signal() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for setjmp() and longjmp().../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for a strtoll() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for a strtold() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for byte order.../usr/bin/cc   -o ./conftest conftest.c
little-endian
checking for dlopen() interface.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
/usr/bin/cc  -Wall -Werror -DHAVE_DLFCN_H -o ./conftest conftest.c
/tmp/cc5i7BP0.o: In function `main':
conftest.c:(.text+0x19): undefined reference to `dlopen'
conftest.c:(.text+0x22): undefined reference to `dlerror'
conftest.c:(.text+0x3b): undefined reference to `dlsym'
collect2: ld returned 1 exit status
-> failed (0)
no
checking for dlopen() in -ldl.../usr/bin/cc  -Wall -Werror -DHAVE_DLFCN_H -ldl -
o ./conftest conftest.c
yes
checking for dyld interface.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
conftest.c:2:25: error: mach-o/dyld.h: No such file or directory
-> failed (0)
/usr/bin/cc  -Wall -Werror -o ./conftest conftest.c
conftest.c: In function ‘main’:
conftest.c:7: error: ‘NSObjectFileImage’ undeclared (first use in this function)
conftest.c:7: error: (Each undeclared identifier is reported only once
conftest.c:7: error: for each function it appears in.)
conftest.c:7: error: expected ‘;’ before ‘img’
conftest.c:8: error: ‘NSObjectFileImageReturnCode’ undeclared (first use in this 
function)
conftest.c:8: error: expected ‘;’ before ‘rv’
conftest.c:10: error: ‘rv’ undeclared (first use in this function)
cc1: warnings being treated as errors
conftest.c:10: error: implicit declaration of function 
‘NSCreateObjectFileImageFromFile’
conftest.c:10: error: ‘img’ undeclared (first use in this function)
conftest.c:11: error: ‘NSObjectFileImageSuccess’ undeclared (first use in this 
function)
-> failed (0)
no
checking for shl_load() interface.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
conftest.c:2:16: error: dl.h: No such file or directory
-> failed (0)
/usr/bin/cc  -Wall -Werror -ldld -o ./conftest conftest.c
cc1: warnings being treated as errors
conftest.c: In function ‘main’:
conftest.c:11: error: implicit declaration of function ‘shl_load’
conftest.c:11: error: ‘BIND_IMMEDIATE’ undeclared (first use in this function)
conftest.c:11: error: (Each undeclared identifier is reported only once
conftest.c:11: error: for each function it appears in.)
conftest.c:12: error: implicit declaration of function ‘shl_findsym’
conftest.c:12: error: ‘shl_t’ undeclared (first use in this function)
conftest.c:12: error: expected expression before ‘)’ token
conftest.c:13: error: expected expression before ‘)’ token
conftest.c:14: error: implicit declaration of function ‘shl_unload’
conftest.c:14: error: expected ‘)’ before ‘handle’
conftest.c:9: error: unused variable ‘p’
-> failed (0)
no
checking for the gettimeofday() function.../usr/bin/cc  -Wall -Werror -o 
../conftest conftest.c
yes
checking for the select() interface.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for a setproctitle() function.../usr/bin/cc  -Wall -Werror -o 
../conftest conftest.c
cc1: warnings being treated as errors
conftest.c: In function ‘main’:
conftest.c:7: error: implicit declaration of function ‘setproctitle’
-> failed (0)
no
checking for a syslog() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for syslog_r().../usr/bin/cc  -Wall -Werror -o ./conftest conftest.c
conftest.c: In function ‘main’:
conftest.c:6: error: variable ‘sdata’ has initializer but incomplete type
conftest.c:6: error: ‘SYSLOG_DATA_INIT’ undeclared (first use in this function)
conftest.c:6: error: (Each undeclared identifier is reported only once
conftest.c:6: error: for each function it appears in.)
conftest.c:6: error: storage size of ‘sdata’ isn’t known
cc1: warnings being treated as errors
conftest.c:7: error: implicit declaration of function ‘syslog_r’
conftest.c:6: error: unused variable ‘sdata’
-> failed (0)
no
checking for vsyslog().../usr/bin/cc  -Wall -Werror -o ./conftest conftest.c
yes
checking for vsyslog_r().../usr/bin/cc  -Wall -Werror -o ./conftest conftest.c
conftest.c: In function ‘foofn’:
conftest.c:8: error: variable ‘sdata’ has initializer but incomplete type
conftest.c:8: error: ‘SYSLOG_DATA_INIT’ undeclared (first use in this function)
conftest.c:8: error: (Each undeclared identifier is reported only once
conftest.c:8: error: for each function it appears in.)
conftest.c:8: error: storage size of ‘sdata’ isn’t known
cc1: warnings being treated as errors
conftest.c:10: error: implicit declaration of function ‘vsyslog_r’
conftest.c:8: error: unused variable ‘sdata’
-> failed (0)
no
checking for the glob() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for the getopt() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for the execvp() function.../usr/bin/cc  -Wall -Werror -o ./conftest 
conftest.c
yes
checking for clock_gettime() interface (w/o -lrt).../usr/bin/cc  -Wall -Werror  
-o ./conftest conftest.c 
/tmp/cchlxFZY.o: In function `main':
conftest.c:(.text+0x19): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
-> failed (0)
no
checking for clock_gettime() interface (with -lrt).../usr/bin/cc  -Wall -Werror  
-o ./conftest conftest.c -lrt
yes
checking for winmm time interface.../usr/bin/cc  -Wall -Werror  -o ./conftest 
conftest.c -lwinmm
conftest.c:4:21: error: windows.h: No such file or directory
conftest.c:5:22: error: mmsystem.h: No such file or directory
conftest.c: In function ‘main’:
conftest.c:11: error: ‘DWORD’ undeclared (first use in this function)
conftest.c:11: error: (Each undeclared identifier is reported only once
conftest.c:11: error: for each function it appears in.)
conftest.c:11: error: expected ‘;’ before ‘t0’
cc1: warnings being treated as errors
conftest.c:13: error: implicit declaration of function ‘timeBeginPeriod’
conftest.c:15: error: ‘t0’ undeclared (first use in this function)
conftest.c:15: error: implicit declaration of function ‘timeGetTime’
conftest.c:16: error: implicit declaration of function ‘Sleep’
-> failed (0)
no
checking for SDL (http://www.libsdl.org)...yes (1.2.14)
checking whether SDL works.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -Wall -
Werror -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -o ./conftest conftest.c 
-L/usr/lib -lSDL
yes
checking for OpenGL (http://www.opengl.org)...yes
checking whether OpenGL works.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -
Wall -Werror  -o ./conftest conftest.c  -L/usr/local/lib -lGL
yes
checking for the X window system.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -
Wall -Werror  -o ./conftest conftest.c  -lX11
yes
checking for the GLX interface.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -
Wall -Werror   -o ./conftest conftest.c  -L/usr/local/lib -lGL 
yes
checking for the WGL interface.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -
Wall -Werror  -o ./conftest conftest.c  -L/usr/local/lib -lGL -lgdi32
conftest.c:1:21: error: windows.h: No such file or directory
conftest.c: In function ‘main’:
conftest.c:4: error: ‘HWND’ undeclared (first use in this function)
conftest.c:4: error: (Each undeclared identifier is reported only once
conftest.c:4: error: for each function it appears in.)
conftest.c:4: error: expected ‘;’ before ‘hwnd’
conftest.c:5: error: ‘HDC’ undeclared (first use in this function)
conftest.c:5: error: expected ‘;’ before ‘hdc’
conftest.c:6: error: ‘HGLRC’ undeclared (first use in this function)
conftest.c:6: error: expected ‘;’ before ‘hglrc’
conftest.c:8: error: ‘hwnd’ undeclared (first use in this function)
cc1: warnings being treated as errors
conftest.c:8: error: implicit declaration of function ‘CreateWindowEx’
conftest.c:8: error: ‘WS_OVERLAPPEDWINDOW’ undeclared (first use in this 
function)
conftest.c:8: error: ‘CW_USEDEFAULT’ undeclared (first use in this function)
conftest.c:9: error: ‘NULL’ undeclared (first use in this function)
conftest.c:9: error: implicit declaration of function ‘GetModuleHandle’
conftest.c:10: error: ‘hdc’ undeclared (first use in this function)
conftest.c:10: error: implicit declaration of function ‘GetDC’
conftest.c:11: error: ‘hglrc’ undeclared (first use in this function)
conftest.c:11: error: implicit declaration of function ‘wglCreateContext’
conftest.c:12: error: implicit declaration of function ‘SwapBuffers’
conftest.c:13: error: implicit declaration of function ‘wglDeleteContext’
conftest.c:14: error: implicit declaration of function ‘ReleaseDC’
conftest.c:15: error: implicit declaration of function ‘DestroyWindow’
-> failed (0)
no
checking for FreeType (http://www.freetype.org)...yes (12.0.6)
checking whether FreeType works.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -
Wall -Werror -I/usr/include/freetype2 -o ./conftest conftest.c -lfreetype -lz
yes
checking for libjpeg (ftp://ftp.uu.net/graphics/jpeg/)...yes
checking whether libjpeg works.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -
Wall -Werror -I/usr/include -o ./conftest conftest.c -L/usr/lib -ljpeg
yes
checking for libpng (http://www.libpng.org)...yes (1.2.44)
checking whether libpng works.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -
Wall -Werror -I/usr/include/libpng12 -o ./conftest conftest.c -L/usr/lib -lpng12
yes
checking for POSIX threads.../usr/bin/cc  -D_AGAR_INTERNAL -D_BSD_SOURCE -Wall -
Werror  -o ./conftest conftest.c -lpthread
yes
checking for the X/Open Threads Extension.../usr/bin/cc  -D_AGAR_INTERNAL -
D_BSD_SOURCE  -Wall -Werror -U_XOPEN_SOURCE -D_XOPEN_SOURCE=600 -o ./conftest 
conftest.c -lpthread
yes
checking for PTHREAD_MUTEX_RECURSIVE.../usr/bin/cc  -D_AGAR_INTERNAL -
D_BSD_SOURCE  -Wall -Werror  -o ./conftest conftest.c -lpthread
cc1: warnings being treated as errors
conftest.c: In function ‘main’:
conftest.c:7: error: implicit declaration of function 
‘pthread_mutexattr_settype’
conftest.c:7: error: ‘PTHREAD_MUTEX_RECURSIVE’ undeclared (first use in this 
function)
conftest.c:7: error: (Each undeclared identifier is reported only once
conftest.c:7: error: for each function it appears in.)
-> failed (0)
no
checking for PTHREAD_MUTEX_RECURSIVE_NP.../usr/bin/cc  -D_AGAR_INTERNAL -
D_BSD_SOURCE  -Wall -Werror  -o ./conftest conftest.c -lpthread
cc1: warnings being treated as errors
conftest.c: In function ‘main’:
conftest.c:7: error: implicit declaration of function 
‘pthread_mutexattr_settype’
-> failed (0)
no

_______________________________________________
Agar mailing list
Agar <at> hypertriton.com
http://libagar.org/lists.html
Ben Collver | 4 Nov 2012 20:37
Picon

Problem setting focus on VG_View

Good day,

I am trying to programmatically set focus on a VG_View widget that takes 
up a whole window.  It does not seem to work as expected. Below is a 
test program to demonstrate the problem.  I compile and run this program 
on Linux.  It opens an SDL window, which has focus.  If I press a key, 
the program prints no key-down lines.  If I click anywhere in the window 
and press a key, then the program generates key-down lines.

The debug messages show that AG_WidgetFocus() returns 1 for success, and 
window->nFocused increases from 0 to 1.  However, the debug messages 
also show that AG_WidgetIsFocused() returns 0, which seems to contradict 
the other results.

Am I missing a step to set focus on the VG_View widget?  Any help would 
be appreciated.

Thank you,

-Ben

/* *****
Compilation:
cc -g $(agar-config --cflags) $(agar-vg-config --cflags) vg.c 
-L/home/ben/local/lib -Wl,-R/home/ben/local/lib $(agar-config --libs) 
$(agar-vg-config --libs) -lSDL_image

Output:
DEBUG before AG_WindowFocus
DEBUG Window focus=0
DEBUG Widget focus=0
DEBUG Window nFocused=0
DEBUG result=0

DEBUG after AG_WindowFocus, before AG_WidgetFocus
DEBUG Window focus=0
DEBUG Widget focus=0
DEBUG Window nFocused=0
DEBUG result=0

DEBUG after AG_WidgetFocus
DEBUG Window focus=0
DEBUG Widget focus=0
DEBUG Window nFocused=1
DEBUG result=1

DEBUG key-down unicode=103
***** */

#include <stdio.h>
#include <agar/core.h>
#include <agar/gui.h>
#include <agar/vg.h>

void callback(AG_Event *event) {
     unsigned long unicode = AG_ULONG_NAMED("unicode");
     printf("DEBUG key-down unicode=%ld\n", unicode);
     return;
}

void debugme(AG_Window *win, VG_View *view, int result, char *text) {
     printf("DEBUG %s\n", text);
     printf("DEBUG Window focus=%d\n", AG_WindowIsFocused(win));
     printf("DEBUG Widget focus=%d\n", AG_WidgetIsFocused(view));
     printf("DEBUG Window nFocused=%d\n", win->nFocused);
     printf("DEBUG result=%d\n\n", result);
     return;
}

int main(int argc, char *argv[]) {
     int result;
     AG_Window *win;
     VG *vg;
     VG_Circle *circle;
     VG_Color color;
     VG_Point *point;
     VG_Vector pos;
     VG_View *view;

     result = AG_InitCore("agarswig-vg-demo", AG_NO_CFG_AUTOLOAD);
     if (result == -1) {
         puts(AG_GetError());
         exit(1);
     }
     result = AG_InitGraphics("sdlfb(width=256:height=176:depth=32");
     if (result == -1) {
         puts(AG_GetError());
         exit(1);
     }
     VG_InitSubsystem();
     vg = VG_New(0);
     pos = VG_GetVector(128.0, 88.0);
     point = VG_PointNew(vg->root, pos);
     circle = VG_CircleNew(vg->root, point, 50);
     color = VG_GetColorRGB(255, 0, 0);
     VG_SetColorv(circle, &color);
     win = AG_WindowNew(AG_WINDOW_PLAIN);
     AG_WindowSetGeometryMax(win);
     view = VG_ViewNew(win, vg, VG_VIEW_EXPAND);
     AG_SetEvent(view, "key-down", callback, NULL);
     debugme(win, view, 0, "before AG_WindowFocus");
     AG_WindowFocus(win);
     debugme(win, view, 0, "after AG_WindowFocus, before AG_WidgetFocus");
     AG_WidgetSetFocusable(view, 1);
     result = AG_WidgetFocus(view);
     debugme(win, view, result, "after AG_WidgetFocus");
     AG_WindowShow(win);
     AG_EventLoop();
     VG_Destroy(vg);
     VG_DestroySubsystem();
     AG_QuitGUI();
     exit(0);
}
Josh Branning | 20 Oct 2012 22:36
Picon

Troubles running agar example programs, and a question about agarwm.

Hello everyone,

1) First of all, I'd like to thank you for all your work on agar etc.

2) I am having troubles running the example programs on Debian
GNU/linux. Agar compiled fine, installed fine, built the example
helloagar fine, but doesn't run it. The error I get in gdb is:

Program received signal SIGSEGV, Segmentation fault.
__strlen_sse2 () at ../sysdeps/i386/i686/multiarch/strlen.S:99
99      ../sysdeps/i386/i686/multiarch/strlen.S: No such file or directory.
        in ../sysdeps/i386/i686/multiarch/strlen.S
Current language:  auto
The current source language is "auto; currently asm".

3) I would like to know more about the progress of agarwm, specifically,
is it functional? Can I download it somewhere? Is it ICCCM/NetWM
compliant? It'd be great if you could get back to me on this.

Once again thank you for your work,

Thanks,

Josh.
Jakob R. | 24 Jul 2012 17:05
Picon

Building Agar 1.4.1 with Visual Studio 2010

Hello,

I was trying to compile Agar dynamic libraries with VS 2010 as the
precompiled Windows DLLs are missing exported symbols. Static linking
is not an option for my project. I use the source code distribution
for MSVC downloadable on the libagar.org site. However, there were
some obstacles I'd like to discuss.

First, a file config/have_png.h seems to be missing in the MSVC
project archive. I commented out the include on line 40 in
gui/load_png.c to bypass this.

There are still no symbols exported from the freshly compiled DLLs
because the export declaration is missing. The reason is, that the
appropriate #define in core/begin.h (and gui/begin.h) is never
reached. MSVC does not define __WIN32__ but _WIN32 when the
preprocessor is run. I added this in begin.h and now most symbols get
exported.

Some are still missing, however, because each header file seems to
come in two flavors: one with the DECLSPEC in the include subfolder
and one without the DECLSPEC in the same folder as the C source files
(are there any more differences between them?). For example, agConfig
is defined in core/core.c which includes "config.h" where the DECLSPEC
is missing. Thus, agConfig is not exported from ag_core.dll. If I
change the include directive to look for <core/config.h> instead, it
works. AG_Snprintf, AG_LabelNew and more are not exported for the same
reason.

Maybe agConfig and others (e. g. agClassTree) should not be public to
other assemblies (I'm not an expert with neither Agar nor C
development) to prevent unwanted modification? But they are accessed
by ag_gui. In the distributed MSVC project files ag_gui references
ag_core_static which probably means that ag_gui.dll links statically
against ag_core_static.lib. This lead to access violations because of
null pointers when I tried to use both DLLs dynamically: AG_InitCore
initialized the class tree in ag_core.dll space but AG_InitGraphics
used the class tree statically linked in ag_gui.dll which was still
uninitialized. But I cannot drop ag_core.dll either because ag_gui.dll
does not export the core functions (which it statically carries).

What is the desired architecture here?  I expected ag_gui.dll to
depend on ag_core.dll and use the variables exported from there (which
requires the header inclusion changes described above). That's why I
changed the reference in ag_gui from ag_core_static to ag_core (the
DLL project) and edited the begin.h headers once again to have the
DECLSPEC be __declspec(dllimport) if the header is externally
included. (You'll find what I ended up with in include/core/begin.h
below.)  Now I can at least invoke AG_InitCore and AG_InitVideo
successfully with dynamically loaded core and gui DLLs but there are
more unexported symbols like AG_LabelNew, AG_Getopt and probably more.

With regards,
Jakob

PS. has the Wiki gone permanently? It's unreachable at the moment and
I can't find an obvious link from libagar.org anymore.

--- relevant part of include/core/begin.h with adaptions described above ---
# elif defined(__WIN32__) || defined(_WIN32)
#  ifdef _AGAR_CORE_INTERNAL
#    ifdef __BORLANDC__
#      define DECLSPEC
#    else
#      define DECLSPEC	__declspec(dllexport)
#    endif
#  else
#    define DECLSPEC	__declspec(dllimport)
#  endif

I don't know whether this is correct for the ex-Borland compiler.
Equivalent changes applied to include/gui/begin.h as well with the
other internal definition, of course.
nenad jalsovec | 21 May 2012 04:58
Picon

no sub-menus with SDL + OpenGL + custom event loop

Hello,

I'm considering to use Agar for GUI on top of my SDL/OpenGL
application. I've been playing around with it for couple of days and
it looks neat overly but I exeprienced some quirks.

Below is a minimal code example that compiles on windows with VC 2008.
The problem is that menu sub-item doesn't show up when I click on the
main menu item. However, the same menu setup works as intended when
using default event loop via AG_EventLoop() and without any SDL or GL
code.

I'm not sure I'm doing everything right as there are no code examples
for the case of custom loop with GL+SDL
If anybody has had experience with this, please shed some light.

Thanks,

Nenad

#include <windows.h>
#include <gl/gl.h>
#include "SDL.h"
#include <agar/core.h>
#include <agar/gui.h>

int main(int argc, char **argv){

	// init sdl
	if( SDL_Init(SDL_INIT_EVERYTHING) < 0 ){
		exit(1);
	}
	if( ! SDL_SetVideoMode( 640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF |
SDL_OPENGL ) ){
		exit(1);
	}

	// init agar
	if( AG_InitCore( "SDL+OGL+AGAR", 0) == -1 ){
		exit(1);
	}
	AG_InitVideoSDL( SDL_GetVideoSurface(), AG_VIDEO_OVERLAY);

	// create agar window
	AG_Window * win = AG_WindowNew( 0 );
	AG_LabelNew( win, 0, "Hello, world!");
	AG_WindowShow( win );
	
	// crate a menu with one sub-node
	AG_Menu *menu = AG_MenuNew(win, 0);
	AG_MenuItem *item = AG_MenuNode(menu->root, "Menu", NULL);
	AG_MenuNode(item, "Node", NULL);

	// main loop
	bool loop = true;
	SDL_Event e;
	while( loop ){
		while( SDL_PollEvent( &e )){
			// pass the events to agar
			AG_DriverEvent dev;
			AG_SDL_TranslateEvent( agDriverSw, & e, &dev );
			AG_ProcessEvent(NULL, &dev);
		}

		// some opengl code
		glClearColor(0.4, 0.5, 0.4, 1.0);
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

		// draw the agar window
		if (agDriverSw){
			AG_BeginRendering(agDriverSw);
			AG_WindowDraw(win);
			AG_EndRendering(agDriverSw);
		}
		
		SDL_GL_SwapBuffers();
	}

	return 0;
}

Gmane