On 16 Oct 2005 at 18:09, gmjimen@burdjia.com wrote:
Hello,
I'm trying to use GPC but I'm in troubles. I've looking for advice at "crystal/gpc/en" but I didn't find much.
I wrote the next program:
PROGRAM P; (* Ejemplo de uso de GNU Pascal, para ir abriendo boca. *)
BEGIN Writeln ('¡Hola, Mundo!'); END.
(You see, I'm spanish ;^))
I can compile it next way:
1.- I've copied the "C:\mingw\lib\gcc-lib\mingw32\3.2.3\libgpc.a" file to the "C:\mingw\lib" directory.
Totally unnecessary, and generally a bad idea. Remove it from there.
2.- I've used "gpc -c -o p.o p.pas" to get the object file. 3.- I've used "gcc -o p.exe p.o -lgpc" to get the executable file.
This is also unnecessary.
Either of these should do it: "gpc p.pas -o p.exe" or "gpc p.pas --executable-file-name"
The result is an exe file that runs, but I tink is too big (1.012.587 bytes!).
Because it has debug information in it. Supply the "-s" switch when compiling to strip the debug information from the executable:
"gpc -s p.pas --executable-file-name"
Don't forget the "--automake" or "--autobuild" switch if your program uses any other units.
If I try to use "gcc p.pas" it says "gcc: p.pas: Pascal compiler not installed on this system". (Both MingW32 and GPC were installed in C:/mingw).
If I try to use "gpc p.pas" it says "C:/mingw/lib/gcc-lib/mingw32/3.2.3/../../../../mingw32/bin/ld.exe: cannot find -lgcc"
The files I've used to install gcc and gpc are:
- binutils-2.15.91-20040904-1.tar.gz
- gcc-core-3.4.2-20040916-1.tar.gz
- mingw32-make-3.80.0-3.tar.gz
- mingw-runtime-3.8.tar.gz
- w32api-3.3.tar.gz
- gpc-20030209-gcc-3.2.2.i386-pc-mingw32-2.tar.gz
- gpc-mingw-gcc-2.95.3-6-depends.tar.gz
A mish-mash of versions! GCC is 3.4.2, and the GPC installation is based on gcc-3.2.2, and you are also using a series of libraries for gcc-2.95.3-6. This is a recipe for confusion, as you have seen.
Download and install this: http://gnu-pascal.de/contrib/chief/win32/mingw32/gpc-20050331-with- gcc.i386-pc-mingw32.tar.gz
and you should be alright.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/