I redirect this mail to the gpc list. It is a problem about install of gpc/grx which may interest others. There have been problems with CPP_PREDEFINES in Linux (Debian). They are worked around, but others remain ... Maurice
Shutian Ma a écrit:
I used gpc -v and got: gpc version 20041218 based on gcc-3.3.3
I added {$define linux} before of after {$define LINUX_CONSOLE} in grx.pas.
and got:
[root@localhost pascal]# make -f makefile.lnx gpc --automake -O1 -Wall -o blt_test blt_test.pas -L../lib/unix ../lib/unix/libgrx20.a -lvga -lm /usr/bin/ld: cannot find -lgcc collect2: ld returned 1 exit status make: *** [blt_test] Error 1 [root@localhost pascal]#
Could you tell me the next step?
This time, you have a problem of installation of gpc (Pascal). You have some verson of gcc (C) installed. To know which one type gcc -v It is probably different from gcc-3.3.3 which served as backend version of gcc when compiling gpc. You need _this_ version of gcc installed because gpc looks for the version of libgcc.a with same version number as the one which served as backend to compile gpc. Fortunately two (or many) versions of gcc can coexist on the same system. they are recognized through a version number in the libraries. For example yoy have probably a directory /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/ which contains libgcc.a and executables gpc1 and gpcpp which have been installed by gpc, but not libgcc.a nor executable cc1 (as well as some other files) which should have been installed by gcc-3.3.3 To enable this to work you should install all the files that gcc-3.3.3 put in _this_ directory. You probably have similar files installed in an other directory with version number which corresponds to your main gcc version given by gcc -v. You should thus install only those files of gcc-3.3.3 in the proper lib subdirectory I am not used on how you install files in Debian (I use DJGPP or sometimes mingw32). May be untar the _binaries_ of gcc-3.3.3 in some temp directory and move the files to the right directory. Or install gcc-3.3.3: you risk to overwrite compiler driver files like /usr/local/bin/gcc.exe. In that case reinstall afterwards your main gcc version, il will overwrite anew this file, but the files contained in lib/gcc-lib/.. will not be overwritten because they are in different directories discriminated by version number.
Maurice
--- Maurice Lombardi Maurice.Lombardi@ujf-grenoble.fr wrote:
Shutian Ma a écrit:
Thank you,
I have delete the "." , then tried: I checked blt_test.pas, no similar sentence. What I should
do?
[shma@localhost pascal]$ locate libgrx20.a /usr/local/lib/libgrx20.a /home/shma/gnu_pascal/grx246/lib/unix/libgrx20.a [shma@localhost pascal]$
[shma@localhost pascal]$ make -f makefile.lnx gpc --automake -O1 -Wall -o blt_test blt_test.pas -L../lib/unix ../lib/unix/libgrx20.a -lvga -lm /usr/bin/ld: cannot find -lgrx20X collect2: ld returned 1 exit status make: *** [blt_test] Error 1 [shma@localhost pascal]$
{ Define this if you want to use the Linux console version. (Ignored on non-Linux systems.) } {$define LINUX_CONSOLE}
{$gnu-pascal,I-} {$ifdef __DJGPP__} {$L grx20} {$elif defined (__MINGW32__)} {$L grx20} {$elif defined (_WIN32)} {$L grxW32, vfs.c, user32, gdi32} {$elif defined (linux) and defined
(LINUX_CONSOLE)}
{$L grx20, vga} {$else} {$L grx20X, X11} {$endif}
{ Uncomment those of the following libraries that
you
need }
mmm. starting with gcc 3.3.x there are problems with CPP_PREDEFINES in gpc I was supposing that this causes problems only with DOS/Windows targets. But I have checked that linux is no more predefined with gcc-3.3.3. you can check your version of gpc and of its backend gcc by typing gpc -v. The temporary workaround is to add a line {$define linux} before of after {$define LINUX_CONSOLE} in grx.pas.
Maurice
-- Maurice Lombardi Laboratoire de Spectrometrie Physique, Universite Joseph Fourier de Grenoble, BP87 38402 Saint Martin d'Heres Cedex FRANCE Tel: 33 (0)4 76 51 47 51 Fax: 33 (0)4 76 63 54 95 mailto:Maurice.Lombardi@ujf-grenoble.fr