[Gambas-user] ncurses - macro is not found
Sprachschule Eilert
eilert-sprachen at ...221...
Thu Mar 3 09:10:26 CET 2011
Am 02.03.2011 21:21, schrieb Benoît Minisini:
>> I do not have that much idea of how that works under C, so that's why I
>> ask here.
>>
>> In the ncurses library, there are macros. One of them is needed to get
>> the dimensions of the "window". But when I define it
>>
>> EXTERN getmaxyx(...
>>
>> when my program starts, there is merely the error "cannot find symbol
>> getmaxyx in library ncurses".
>>
>> So what can I do here?
>>
>> Regards
>> Rolf
>>
>
> A macro is not a function. It is some code replaced by some other code at
> compilation time. The "getmaxyx" identifier does not exist in the executable.
>
> You must read the C header file to see what the getmaxyx() macro actually
> does.
>
> The gcc compiler has the "-E" option that can help you, by writing to the
> standard output the real code that will be compiled once all macros have been
> expanded.
>
> Regards,
>
Thanks for the tip. I am aware of what a macro in general does, but I do
not understand the result of this thing:
getmaxyx(stdscr, y, x);
becomes
(y = ((stdscr)?((stdscr)->_maxy + 1):(-1)), x =
((stdscr)?((stdscr)->_maxx + 1):(-1)));
and I do not know what "?", "->" and ":" are good for... I guess, the
basic functions are called maxy and maxx, but why with "_" etc...?
When I try to simply declare maxx and maxy in my Gambas program, I
merely get a "Type mismatch: wanted Integer, got Function" instead.
I guess you know what I mean ;-)
Regards
Rolf
--
Rolf-Werner Eilert
SPRACHSCHULE EILERT
Kollegienwall 19 - 49074 Osnabrück
www.eilert-sprachen.de - 0541/22653
More information about the User
mailing list