[fpc-pascal] Basically on the right track?

Sven Barth pascaldragon at googlemail.com
Thu Dec 27 16:29:52 CET 2012


On 27.12.2012 16:11, Patrick wrote:
> :fpc hello_gtk.pas
> Free Pascal Compiler version 2.4.0-2 [2010/02/20] for x86_64

Try to update to FPC 2.6.0. 2.4.0 is quite old already (around 3 years).

> Copyright (c) 1993-2009 by Florian Klaempfl
> Target OS: Linux for x86-64
> Compiling hello_gtk.pas
> Linking hello_gtk
> /usr/bin/ld: warning: link.res contains output sections; did you forget -T?
> /usr/bin/ld: cannot find -lgtk
> hello_gtk.pas(70,1) Error: Error while linking
> hello_gtk.pas(70,1) Fatal: There were 1 errors compiling module, stopping
> Fatal: Compilation aborted
> Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not
> specify a source file to be compiled)
[snip]
> PROGRAM hello_world;
>
> USES gtk, gdk, glib;

This is exactly what I thought. You are trying to use the GTK1 unit. The 
unit for GTK+ is called "gtk2". Take a look into "packages/gtk" and 
"packages/gtk2" of a Free Pascal source folder to see the differences in 
the units (just look at the *.pas/*.pp files and ignore the *.inc files 
for now).

Also you could try whether you can compile the examples listed in 
"packages/gtk2/examples".

Regards,
Sven



More information about the fpc-pascal mailing list