> When I try to compile anything, even the simplest program, I get:
> /usr/i486-linux/bin/ld: cannot open crt0.o: No such file or directory
Perhaps the versions of GCC and GPC you are using don't coincide.
Please check the following:
gpc -c myprogram.pas
gcc myprogram.o -o myprogram
i.e. compile with GPC, but link with GCC.
Did you already check that crt0.o is in a directory where GPC can
find it? I remember some problems when I had crt0.o in the directory
/usr/lib/gcc-lib/i486-…
[View More]unknown-linux/2.6.3. The problems disappeared
when I moved the file to /usr/lib or /usr/local/lib.
Good luck,
Peter
e-mail: peter.gerwinski(a)uni-essen.de
home address: D\"usseldorfer Str. 35, 45145 Essen, Germany
WWW: http://agnes.dida.physik.uni-essen.de/~peter/
[View Less]
According to Berend de Boer:
> Can we not simply see a C .h file as an interface-only module? I mean I can
> simply import a c .h file which gpc parses and all symbols defined in that
> header file are exported symbols?
This would mean that GPC would have to parse C source.
Remember that #include "foo.h" or (*$include "foo.h" *) just means
that GPC treads the file `foo.h' just if its contents were written
in our source file. A Pascal program using this mechanism would
in fact look …
[View More]like the following:
Program Test;
extern int foo;
extern void ioctl (int fildes, int cmd, ...);
begin
[...]
end.
You don't actually want this. ;-)
> I don't know how far this is feasible. And it doesn't cover a.out modules
> creating using other languages (GNAT, ...). But it does cover the majority of
> cases you need externals.
You can write a C header file for everything you want to import,
independently of the language it was originally written in. Our
point is that it must also be possible to write a *Pascal* interface
for everything we want to import.
Peter
e-mail: peter.gerwinski(a)uni-essen.de
home address: D\"usseldorfer Str. 35, 45145 Essen, Germany
WWW: http://agnes.dida.physik.uni-essen.de/~peter
[View Less]
> Now I am looking out for reasonable ideas.
Can we not simply see a C .h file as an interface-only module? I mean I can
simply import a c .h file which gpc parses and all symbols defined in that
header file are exported symbols?
I don't know how far this is feasible. And it doesn't cover a.out modules
creating using other languages (GNAT, ...). But it does cover the majority of
cases you need externals.
Groetjes,
Berend.
Hello Patricio,
> I currently teaching Operative System to students who only know Pascal,
> so I'd like to know if we can use
> Unix System calls in pascal programs wirh GPC ? I mean stuff like
> 'fork()', 'exec()', etc...
You can access any function using the "external", "C", and "asmname"
directives:
Procedure fork; external;
means: there is an external Procedure "Fork" (first letter uppercase),
Procedure fork; C;
means: there is an external Procedure "fork" (…
[View More]everything lowercase), and
Procedure fork; asmname 'foO';
means: there is an external Procedure with the funny name "foO"
(last letter is uppercase in this example) which can be accessed
from Pascal via the name "fork".
Good luck,
Peter
[View Less]
Hi,
I currently teaching Operative System to students who only know Pascal,
so I'd like to know if we can use
Unix System calls in pascal programs wirh GPC ? I mean stuff like
'fork()', 'exec()', etc...
Thanks in advance,
Patricio.
Hi all. I've had this error ever since I installed gpc, and I've never
figured out why. I'm not all that experienced at unix. When I try to
compile anything, even the simplest program, I get:
/usr/i486-linux/bin/ld: cannot open crt0.o: No such file or directory
Sorry if this seems like such a stupid question. Any ideas?
-john
According to Harry Reed:
> In the users' manual chapter "About Pascal and Extended Pascal
> languages"
> there is a small example on how to initialize constant strings. When I
> try
> compiling the fragment with gpc 1.2(2.7.2)#7 I get the error messages
> as showm below. Is this a valid bug or am I just doing something wrong?
Extended Pascal initialized *structured* variables are not (yet)
implemented into GPC, only (parts of) Borland Pascal style initializers.
However …
[View More]some fragments of Extended Pascal initializers *do* exist in
gpc-parse.y, but I don't know when they will work.
Everybody be invited to help implementing this!
> MyStrings : array [1..MyStringsCount] of Ident value [
Square brackets do not work. Use parantheses instead. ^
> 1:'EXPORT'; 2:'IMPLEMENTATION'; 3:'IMPORT';
You may specify Indices etc., but they are ignored completely.
Even worse: Initialization of Strings does not work at all.
Only "simpler" types, i.e. array/record combinations containing
Integers, Reals, etc. work.
This is a known bug, but I forgot to document it.
Thank you for pointing me to it.
> PS: Great work on GPC! Keep it up!!!!
Thanks a lot. :-) :-)
I will continue unless somebody makes big efforts to stop me. ;-)
Peter
[View Less]
Hi,
In the users' manual chapter "About Pascal and Extended Pascal
languages"
there is a small example on how to initialize constant strings. When I
try
compiling the fragment with gpc 1.2(2.7.2)#7 I get the error messages
as showm below. Is this a valid bug or am I just doing something wrong?
Cheers,
Harry Reed
doon(a)hrc.nevada.edu
PS: Great work on GPC! Keep it up!!!!
source program --- cut here --- 8< --- cut here --- 8< --- cut here ---
program test;
const
…
[View More]MyStringsCount = 5;
type
Ident = string(20);
var
MyStrings : array [1..MyStringsCount] of Ident value [
1:'EXPORT'; 2:'IMPLEMENTATION'; 3:'IMPORT';
4:'INTERFACE'; 5:'MODULE'];
begin
end.
compiler output --- cut here --- 8< --- cut here --- 8< --- cut here ---
test.pas: In function `test':
test.pas:9: parse error before `:'
test.pas:9: Set constructor elements must be of ordinal type
test.pas:9: missing comma
test.pas:9: parse error before `;'
test.pas:9: missing comma
test.pas:9: parse error before `:'
test.pas:9: Set constructor elements must be of ordinal type
test.pas:9: missing comma
test.pas:9: parse error before `;'
test.pas:9: missing comma
test.pas:9: parse error before `:'
test.pas:9: Set constructor elements must be of ordinal type
test.pas:9: missing comma
test.pas:9: parse error before `;'
test.pas:10: missing comma
test.pas:10: parse error before `:'
test.pas:10: Set constructor elements must be of ordinal type
test.pas:10: missing comma
test.pas:10: parse error before `;'
test.pas:10: missing comma
test.pas:10: initial value is of wrong type
[View Less]