On Tue, 31 Oct 2000, J Blakeney wrote:
If you unsing any libraries/units you are you have to include them in the gpc command line, for example
gpc program.p -lgpc
to build a program that uses the gpc unit
That neither work. I've got the following program 'test.pas':
program test; uses Crt;
begin gotoXY(1,1); write('hello'); end.
Then save it and trie to compile it:
bash-2.03# gpc test.pas -lcrt # like you wrote # then i get this message /usr/bin/ld: cannot find -lcrt collect2:ld returned 1 exit status
Even when I trie it in the units directory I get this message.
I also tried gpc --automake test.pas : I get the following messages....
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/libgpc.a(randfile.o): In function `do_seek': /home/elug/pascal-wochenende-20000729/gcc-2.95.2/gcc/p/rts/randfile.c:327: the `llseek' function may be dangerous; use `lseek64' instead. /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/crt.o: In function `Textmode': /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/crt.o(.text+0xf2): undefined reference to `crt_check_winchanged' /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/crt.o(.text+0x177): undefined reference to `crt_SetMonochrome' /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/crt.o(.text+0x18a): undefined reference to `crt_SetScreenSize' /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/crt.o(.text+0x1a7): undefined reference to `crt_window'
These are only a vew lines!
That doesn't seem to work. Maybe it's because of my Linux version or My gnu c compiler. I don't know.
Winand Renkema wrote:
On Tue, 31 Oct 2000, J Blakeney wrote:
If you unsing any libraries/units you are you have to include them in the gpc command line, for example
gpc program.p -lgpc
to build a program that uses the gpc unit
That neither work. I've got the following program 'test.pas':
program test; uses Crt;
begin gotoXY(1,1); write('hello'); end.
Then save it and trie to compile it:
bash-2.03# gpc test.pas -lcrt # like you wrote # then i get this message /usr/bin/ld: cannot find -lcrt
There seems to be a slight confusion here...
Do not use `-lfoo' to use a unit called foo, but to use a library called libfoo. (The unit GPC describes the Run Time System which is contained in libgpc, so `-lgpc' works, but since GPC does thsi automatically, it's also unnecessary. But for CRT, there's no libcrt. -- In fact CRT uses a library called ncurses or PDCurses, depending on the platform, but it does this automatically, so you don't need a `-l' option for these either.)
Instead, as Eike Lange said, always use simply `--automake'...
collect2:ld returned 1 exit status
Even when I trie it in the units directory I get this message.
I also tried gpc --automake test.pas : I get the following messages....
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/libgpc.a(randfile.o): In function `do_seek': /home/elug/pascal-wochenende-20000729/gcc-2.95.2/gcc/p/rts/randfile.c:327: the `llseek' function may be dangerous; use `lseek64' instead. /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/crt.o: In function `Textmode': /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/crt.o(.text+0xf2): undefined reference to `crt_check_winchanged'
This might be a consequence of previous compilation attempts without `--automake' (GPC doesn't handle this situation well, unfortunately). Please try removing all *.o, *.gpi and *.gpm files created by them.
Frank