adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] New structure status, thoughts, and problems


From: Kai Sterker
Subject: Re: [Adonthell-devel] New structure status, thoughts, and problems
Date: Sat, 22 Mar 2003 11:58:09 +0100

On Fri, 21 Mar 2003 16:33:23 +0100 Kai Sterker wrote:

> I think I know what the problem is. However, I am also short of time
> right now, so I probably won't be able to look at the code before the
> evening anyway :). So don't worry. If anything is unclear, I'll ask.

Sorry, but I wasn't able to try out things yesterday, but I am looking
at it right now. For what it's worth, here's a list of problems I ran
into:

In file included from ../../src/gfx/gfx.h:31,
                 from gfx.cc:25:
../../src/gfx/surface.h:317: `::ifstream' undeclared (first use here)
../../src/gfx/surface.h:317: `file' was not declared in this scope
../../src/gfx/surface.h:334: `::ofstream' undeclared (first use here)
../../src/gfx/surface.h:334: `file' was not declared in this scope

Including <fstream> in surface.h helped here.


pnm.cc: In function `static void * gfx::pnm::get(ifstream &, short
    unsigned int &, short unsigned int &)':
pnm.cc:42: implicit declaration of function `int printf(...)'
pnm.cc: In function `static void gfx::pnm::put(ofstream &, const char *,
    short unsigned int, short unsigned int)':
pnm.cc:81: implicit declaration of function `int sprintf(...)'

--> #include <stdio.h> in pnm.h


Other than that it compiled and installed fine :). Runs well too,
although it prints "Oki Doki" twice for each keypress. Once for the key
press and once for the release?



On yet a different matter: running the stuff under MacOS X:

First of all, during compilation I got a number of warnings like the
following:

*** Warning: linker path does not have real file for library -lSDLmain.
*** I have the capability to make that library automatically link in
when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libSDLmain and none of the candidates passed a file format test
*** using a file magic. Last file checked: /usr/lib/libSDLmain.a

*** Warning: linker path does not have real file for library -lstdc++.
*** I have the capability to make that library automatically link in
when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libstdc++ and none of the candidates passed a file format test
*** using a file magic. Last file checked:
/usr/lib/gcc/darwin/default/libstdc++.a

*** Warning: libtool could not satisfy all declared inter-library
*** dependencies of module sdl.  Therefore, libtool will create
*** a static module, that should work as long as the dlopening
*** application is linked with the -dlopen flag.

Not sure what that means (but it might explain why stuff didn't run in
the end).


The following was more serious:

In file included from ../../src/python/python.h:25,
                 from python.cc:24:
../../src/python/callback.h:48: parse error before `*' token
../../src/python/callback.h:60: syntax error before `*' token
../../src/python/callback.h:61: syntax error before `*' token
python.cc: In function `void python::show_traceback()':
python.cc:30: `PyErr_Occurred' undeclared (first use this function)
python.cc:30: (Each undeclared identifier is reported only once for each

   function it appears in.)
python.cc:32: `PyErr_Print' undeclared (first use this function)
python.cc:33: `stderr' undeclared (first use this function)
python.cc:33: `fflush' undeclared (first use this function)

As it seems, it confused our lowercase python.h with the uppercase
Python.h :(. (And I thought only Windows would be so stupid!)

I fixed it by renaming our python.h to pyth0n.h, but maybe we should
rename the whole class. Call it "base" or something like that.


And as said above, when trying to run the script, it failed:

Traceback (most recent call last):
  File "test.py", line 1, in ?
    from adonthell import gfx, input, python
  File "/tmp/adonthell/lib/python2.2/site-packages/adonthell/gfx.py",
line 4, in ?
    import _gfx
ImportError: No module named _gfx

But a module called _gfx.a is there, just like on Linux. (Which makes me
wonder: shouldn't that be a _gfx.so instead?)


Anyway, so much for compiling and running the stuff.


On the topic of passing arguments to the callback: maybe a template will
help. But I'm not sure. I'll look into it some more.

Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]