Thanks for the answer of my earlier question. (By Maurice).
I would like to know if there is an easy way to make a x-window application using gpc.
Do I have to use "external" and in that way use the C generated libraries?
Then I also need to create a lot of records that resembles the structs normally used when doing this in C? Or is there a "header file" usable from gpc, so I dont have to rewrite all that is in Xlib.h?
best regards /Anders
On Sat, Aug 30, 2003 at 12:07:34PM +0200, Anders Lindén wrote:
I would like to know if there is an easy way to make a x-window application using gpc.
Please have al look at http://www.gnu-pascal.de/contrib/eike/xlibgpc-20030404.tar.gz
This is a unit usable for pure X programming. Currently, we do not have units for using widget sets like GTK or such.
Eike
The unit "xlib" is giving me an error (sorry for being a newbie). The error is:
(T)WCharT size mismatch!
Observe that this message is coming up when I am running the application I had built with the xlib package, not at compile time. The application is also terminating upon this. What can I change to make the error dissapear? Do I maybe need to alter a bit of the unit code, or is there a compiler switch for automatically converting between the types?
/Anders
----- Original Message ----- From: "Eike Lange" eike.lange@uni-essen.de To: gpc@gnu.de Sent: Saturday, August 30, 2003 3:17 PM Subject: Re: x-window programming
On Sat, Aug 30, 2003 at 12:07:34PM +0200, Anders Lindén wrote:
I would like to know if there is an easy way to make a x-window application using gpc.
Please have al look at http://www.gnu-pascal.de/contrib/eike/xlibgpc-20030404.tar.gz
This is a unit usable for pure X programming. Currently, we do not have units for using widget sets like GTK or such.
Eike
-- "Freie Software braucht Freie Dokumentation." Das GNU-Pascal Buch! http://www.gnu-pascal.de/~eike/
On Sat, Aug 30, 2003 at 11:24:19PM +0200, Anders Lindén wrote:
The unit "xlib" is giving me an error (sorry for being a newbie). The error is: (T)WCharT size mismatch!
WCharT is mentioned in Line 700f and there is a Test in Line 3791:
if CSizeofWCharT <> PSizeofTWCharT then begin WriteLn (StdErr, '(T)WCharT size mismatch!'); Halt end;
Could you please insert a line just before `halt' like this: WriteLn (StdErr, 'WCharT: ', CSizeofWCharT, ' TWCharT: ', PSizeofTWCharT);
Background: I assume, that WCharT is as big as a `MedInt' (Line 700f) what is correct for Debian GNU/Linux on Intel architecture. Different architectures may have different wide Character implementations (sounds silly, I know).
If you can find out (by the given extra line above), how big a WideCharacter on your system is, you could change the type definition by yourself, and mail me your results.
As this is the first test, there may be lots of other test failing. If every size test fails you may have a broken XLib installation (or me...) :-(
Did you try to run the test program (xtest.pas)?
So please try out the above line, report your architecture and your XLib Version (on top of Xlib.h) and the result of your test.
Eike
Eike Lange wrote:
I assume, that WCharT is as big as a `MedInt' (Line 700f) what is correct for Debian GNU/Linux on Intel architecture. Different architectures may have different wide Character implementations (sounds silly, I know).
According to gcc/c-common.c, it has the size of `int' (i.e., `Integer', not `MedInt') -- unless `--short-wchar' is used in which case it's `short unsigned int' (`ShortCard'). But I suppose Xlib doesn't expect that switch -- unless it happens to be the default on some targets ...
Frank
WCharT:2 TWCharT:4
The same error occurs when I run xtest. Not wonder, the same tests are performed. The architecture is cygwin on an Intel, Pentium 4 processor. The version of xlib is: 1.6 2001/02/09 (This header was installed when I was choosing the appropriate checkbox in the cygwin setup-utility, and this installation was done previously).
best regards /Anders
----- Original Message ----- From: "Eike Lange" eike.lange@uni-essen.de To: gpc@gnu.de Sent: Sunday, August 31, 2003 9:33 AM Subject: Re: x-window programming
On Sat, Aug 30, 2003 at 11:24:19PM +0200, Anders Lindén wrote:
The unit "xlib" is giving me an error (sorry for being a newbie). The error is: (T)WCharT size mismatch!
WCharT is mentioned in Line 700f and there is a Test in Line 3791:
if CSizeofWCharT <> PSizeofTWCharT then begin WriteLn (StdErr, '(T)WCharT size mismatch!'); Halt end;
Could you please insert a line just before `halt' like this: WriteLn (StdErr, 'WCharT: ', CSizeofWCharT, ' TWCharT: ', PSizeofTWCharT);
Background: I assume, that WCharT is as big as a `MedInt' (Line 700f) what is correct for Debian GNU/Linux on Intel architecture. Different architectures may have different wide Character implementations (sounds silly, I know).
If you can find out (by the given extra line above), how big a WideCharacter on your system is, you could change the type definition by yourself, and mail me your results.
As this is the first test, there may be lots of other test failing. If every size test fails you may have a broken XLib installation (or me...) :-(
Did you try to run the test program (xtest.pas)?
So please try out the above line, report your architecture and your XLib Version (on top of Xlib.h) and the result of your test.
Eike
-- "Freie Software braucht Freie Dokumentation." Das GNU-Pascal Buch! http://www.gnu-pascal.de/~eike/
Hi!
On Sun, Aug 31, 2003 at 11:02:30AM +0200, Anders Lindén wrote:
WCharT:2 TWCharT:4
On my system: WCharT: 4 TWCharT: 4
Ok, you could change line 701 to: TWCharT = Cardinal; or TWCharT = ShortCard; whatever is usable.
Sorry for "Int", what is AFAIK wrong in my last mail.
Eike