Hello, We have some problems in compilation of BP sources with GPC on Red Hat Linux. The following peice of code in our source is giving copilation problem
procvar = procedure; const nilproc : procvar = nil;
BP supports assinging pointer values to procedure types and we find that GPc doesnot support it.
Expecting your advice on solving the above.
regards hari
Kocherlakota Harikrishna wrote:
We have some problems in compilation of BP sources with GPC on Red Hat Linux. The following peice of code in our source is giving copilation problem
procvar = procedure; const nilproc : procvar = nil;
BP supports assinging pointer values to procedure types and we find that GPc doesnot support it.
Expecting your advice on solving the above.
This works with recent GPC versions (since 20000213, IIRC). I just tested the following program successfully:
program Foo;
type procvar = procedure;
const nilproc : procvar = nil;
begin end.
Frank
Hello,
Thankyou for your prompt help.We have downloaded the latest one gpc-20010107 .The below problem is solved but we have some problem for which we don't know any clue to solve.I am attaching the logging.
thankyou. Regards, Hari
frank@g-n-u.de wrote:
Kocherlakota Harikrishna wrote:
We have some problems in compilation of BP sources with GPC on Red Hat Linux. The following peice of code in our source is giving copilation problem
procvar = procedure; const nilproc : procvar = nil;
BP supports assinging pointer values to procedure types and we find that GPc doesnot support it.
Expecting your advice on solving the above.
This works with recent GPC versions (since 20000213, IIRC). I just tested the following program successfully:
program Foo;
type procvar = procedure;
const nilproc : procvar = nil;
begin end.
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html
[root@stwpgt bin]# ./gpc --automake -Dwin32 -DNODLL --extended-syntax pcamac.pas /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/libgpc.a(string.o): In function `Cstringlastchpos': /root/usr/gcc-2.95.2/gcc/p/rts/string.pas:552: multiple definition of `_p_strrscan' /tmp/ccIE7Eur1.o(.text+0x18f8): first defined here /root/usr/i686-pc-linux-gnu/bin/ld: Warning: size of symbol `_p_strrscan' changed from 140 to 68 in string.o /usr/lib/crt1.o: In function `_start': /usr/lib/crt1.o(.text+0x18): undefined reference to `main' /tmp/ccIE7Eur1.o: In function `Filesplit': /tmp/ccIE7Eur1.o(.text+0xa9): undefined reference to `_p_strpas' /tmp/ccIE7Eur1.o: In function `Callprocvar': /tmp/ccIE7Eur1.o(.text+0x473): undefined reference to `toCall' /tmp/ccIE7Eur1.o: In function `Byte_comp': /tmp/ccIE7Eur1.o(.text+0x1b5e): undefined reference to `Compare' /tmp/ccIE7Eur1.o: In function `Get_exename': /tmp/ccIE7Eur1.o(.text+0x434e): undefined reference to `Get_loadpath' /tmp/ccIE7Eur1.o(.text+0x4437): undefined reference to `_p_strpas' /tmp/ccIE7Eur1.o: In function `init_Pcamac': /tmp/ccIE7Eur1.o(.text+0x5354): undefined reference to `init_Strings' /tmp/ccIE7Eur1.o(.text+0x5359): undefined reference to `init_Pekxac' /tmp/ccIE7Eur1.o(.text+0x535e): undefined reference to `init_Pguzaa' collect2: ld returned 1 exit status
Kocherlakota Harikrishna wrote:
Thankyou for your prompt help.We have downloaded the latest one gpc-20010107 .The below problem is solved but we have some problem for which we don't know any clue to solve.I am attaching the logging.
This looks like a linking conflict. Please remove any old .gpi and .o files compiled with a previous GPC version and any remainings from the old GPC, in particular libgpc.a (normally, they should have been either overwritten or in a directory where the new GPC doesn't find them, but something seems to have gone wrong...).
If that doesn't help, please compile with `-v' (verbose output) and look at the `ld' parameters to find out what is linked. This might give you a clue what's wrong, otherwise please post that output here.
Frank
Thanks again for your help. Infact we emptied all the directories and built the compiler fresh from the tar files. Eventhen we got the same compilation problems. Then we compiled with -v option and are unable to find any clue. Herewith we are attaching the verbose ouput for U to have a look. thanks and regards hari
frank@g-n-u.de wrote:
Kocherlakota Harikrishna wrote:
Thankyou for your prompt help.We have downloaded the latest one gpc-20010107 .The below problem is solved but we have some problem for which we don't know any clue to solve.I am attaching the logging.
This looks like a linking conflict. Please remove any old .gpi and .o files compiled with a previous GPC version and any remainings from the old GPC, in particular libgpc.a (normally, they should have been either overwritten or in a directory where the new GPC doesn't find them, but something seems to have gone wrong...).
If that doesn't help, please compile with `-v' (verbose output) and look at the `ld' parameters to find out what is linked. This might give you a clue what's wrong, otherwise please post that output here.
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html
[root@stwpgt bin]# ./gpc -DNODLL --extended-syntax -v --automake -Dwin32 pcamac.pas Reading specs from /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gpc version 20010107, based on 2.95.2 19991024 (release) /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpcpp -lang-pascal -v -famtmpfile=/tmp/cccJRe1p -fextended-syntax -fautomake -fdelphi-comments -D__GNU_PASCAL__ -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=0 -D__GPC_RELEASE__=20010107 -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -DNODLL -Dwin32 pcamac.pas /tmp/ccQNFlXF.iGNU Pascal Compiler PreProcessor version 2.95.2 19991024 (release) (i386 Linux/ELF)#include "..." search starts here:#include <...> search starts here: /root/usr/include /root/usr/i686-pc-linux-gnu/include /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include /usr/include End of search list. /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpc1 /tmp/ccQNFlXF.i -quiet -dumpbase pcamac.pas -version -famtmpfile=/tmp/cccJRe1p -fextended-syntax -fautomake -o /tmp/ccQNFlXF.sGNU Pascal version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).Reading specs from /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gpc version 20010107, based on 2.95.2 19991024 (release) /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpcpp -lang-pascal -v -fautomake -fextended-syntax -famtmpfile=/tmp/cccJRe1p -fdelphi-comments -D__GNU_PASCAL__-M -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=0 -D__GPC_RELEASE__=20010107 -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__-D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -DNODLL -Dwin32 /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/gpc.pas -o /tmp/ccux0AIu GNU Pascal Compiler PreProcessor version 2.95.2 19991024 (release) (i386 Linux/ELF)#include "..." search starts here:#include <...> search starts here: /root/usr/include /root/usr/i686-pc-linux-gnu/include /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include /usr /includeEnd of search list.Reading specs from /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gpc version 20010107, based on 2.95.2 19991024 (release) /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpcpp -lang-pascal -v -fautomake -fextended-syntax -famtmpfile=/tmp/cccJRe1p -fdelphi-comments -D__GNU_PASCAL__-M -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=0 -D__GPC_RELEASE__=20010107 -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__-D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -DNODLL -Dwin32 /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/units/strings.pas -o /tmp/ccSPIuHe GNU Pascal Compiler PreProcessor version 2.95.2 19991024 (release) (i386 Linux/ELF)#include "..." search starts here:#include <...> search starts here: /root/usr/include /root/usr/i686-pc-linux-gnu/include /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include /usr/include End of search list.Reading specs from /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gpc version 20010107, based on 2.95.2 19991024 (release) /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpcpp -lang-pascal -v -fautomake -fextended-syntax -famtmpfile=/tmp/cccJRe1p -fdelphi-comments -D__GNU_PASCAL__-M -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=0 -D__GPC_RELEASE__=20010107 -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__-D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -DNODLL -Dwin32 pekxac.pas -o /tmp/cccw0db4 GNU Pascal Compiler PreProcessor version 2.95.2 19991024 (release) (i386 Linux/ELF)#include "..." search starts here:#include <...> search starts here: /root/usr/include /root/usr/i686-pc-linux-gnu/include /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include /usr/include End of search list.Reading specs from /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specsgpc version 20010107, based on 2.95.2 19991024 (release) /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/gpcpp -lang-pascal -v -fautomake -fextended-syntax -famtmpfile=/tmp/cccJRe1p -fdelphi-comments -D__GNU_PASCAL__ -M -undef -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__GPC__=2 -D__GPC_MINOR__=0 -D__GPC_RELEASE__=20010107 -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__-D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -DNODLL -Dwin32 pguzaa.pas -o /tmp/ccQ8CX9W GNU Pascal Compiler PreProcessor version 2.95.2 19991024 (release) (i386 Linux/ELF) #include "..." search starts here:#include <...> search starts here: /root/usr/include /root/usr/i686-pc-linux-gnu/include /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include /usr/include End of search list.
model /root/usr/i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccQNFlXF1.o /tmp/ccQNFlXF.s GNU assembler version 2.10 (i686-pc-linux-gnu) using BFD version 2.10 /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtbegin.o -L/root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2 -L/root/usr/i686-pc-linux-gnu/lib -L/root/usr/lib /tmp/ccQNFlXF1.o -lgpc -lm-lgcc -lc -lgcc /root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtend.o /usr/lib/crtn.o/root/usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/libgpc.a(string.o): In function `Cstringlastchpos': /root/usr/gcc-2.95.2/gcc/p/rts/string.pas:552: multiple definition of `_p_strrscan'/tmp/ccQNFlXF1.o(.text+0x1898): first defined here/root/usr/i686-pc-linux-gnu/bin/ld: Warning: size of symbol `_p_strrscan' changed from 140 to 68 in string.o /usr/lib/crt1.o: In function `_start':/usr/lib/crt1.o(.text+0x18): undefined reference to `main'/tmp/ccQNFlXF1.o: In function `Filesplit':/tmp/ccQNFlXF1.o(.text+0xa9): undefined reference to `_p_strpas'/tmp/ccQNFlXF1.o: In function `Callprocvar':/tmp/ccQNFlXF1.o(.text+0x473): undefined reference to `toCall'/tmp/ccQNFlXF1.o: In function `Byte_comp': /tmp/ccQNFlXF1.o(.text+0x1afe): undefined reference to `Compare'/tmp/ccQNFlXF1.o: In function `Get_exename':/tmp/ccQNFlXF1.o(.text+0x42f8): undefined reference to `Get_loadpath'/tmp/ccQNFlXF1.o (.text+0x43b2): undefined reference to `_p_strpas'/tmp/ccQNFlXF1.o: In function `init_Pcamac':/tmp/ccQNFlXF1.o (.text+0x52d4): undefined reference to `init_Strings'/tmp/ccQNFlXF1.o(.text+0x52d9): undefined reference to `init_Pekxac'/tmp/ccQNFlXF1.o(.text+0x52de): undefined reference to `init_Pguzaa'collect2: ld returned 1 exit status
Kocherlakota Harikrishna wrote:
Thanks again for your help. Infact we emptied all the directories and built the compiler fresh from the tar files. Eventhen we got the same compilation problems. Then we compiled with -v option and are unable to find any clue. Herewith we are attaching the verbose ouput for U to have a look.
The output is very hard to read because it has wrong/mostly missing line breaks. The verbose output usually is convoluted enough already, but this one is really like a labyrinth. ;-) Could you please send it again with proper line breaks? (Try redirecting it to a file using `>& file name', and possibly include the file as in MIME base 64 if thing went wrong there...)
Also, could you please give us some information about the unit structure of your project? I assume pcamac.pas contains the main program, right? Are pekxac.pas pguzaa.pas units? Which units (of yours and from GPC) does each file use, and are the `uses' statements in the interface or implementation?
Just to be sure: You're not using a symbol `_p_strrscan' in your own code or have copied a declaration from gpc.pas, are you? That would be likely to cause such problems. (In general, all names starting with `_p_' are reserved by GPC and should not be used in normal code.)
Frank