Forum > GTK

Download, install, and connect libraries on FPC (GTK)

(1/2) > >>

yyttyy:
I'm New! OS: Linux mint. I googled a lot and didn't Google anything, so I had to come here. I have FPC version 3.0.4 and I want to use the gtk library in my project, namely, as I understand it, it still contains Glib, gdk and gtk itself. Here, in my directory with fpc (/usr/lib/x86_64-linux-gnu/fpc/3.0.4/units/x86_64-linux/) there is only gtk2 in which there is almost nothing, and as I understand the functions, types, data structures and constants themselves are described in a slightly different place, which is called the source code. Here is my path to the source (/usr/share/fpcsrc/3.0.4/packages/) and there is also only a gtk2 folder in which gtk.pas and very little is written in it. In General, when I was figuring out where to get the functions themselves, constants, and so on. on some site I saw that one person says: It is necessary to download the source code of Pascal and look at the functions already described there (in fact, from there I learned about the source code) and threw a link to the source code of my version of FPC (3.0.4). I downloaded it and there is a gtk1 folder, in which everything is just described! But the question is why it is not in my source code in the system. If it should not be, then how to "install"this library. Please describe the solution to this problem in as much detail as possible, because I'm quite new)

trev:
Welcome!

I suggest you try the Wiki article Installing Lazarus on Linux which attempts to detail the process for new users. The Wiki also has lots of other useful information. After the Main Page, the Wiki Portals (New Users, HowTo Demos, and Linux) are good places to start.

yyttyy:
Thank u of course, but i need only in GTK. As i understand Lazarus is IDE. I just want to use GTK library in project. So i dont want Lazarus.

PascalDragon:

--- Quote from: yyttyy on October 19, 2020, 11:39:30 pm ---I'm New! OS: Linux mint. I googled a lot and didn't Google anything, so I had to come here. I have FPC version 3.0.4 and I want to use the gtk library in my project, namely, as I understand it, it still contains Glib, gdk and gtk itself. Here, in my directory with fpc (/usr/lib/x86_64-linux-gnu/fpc/3.0.4/units/x86_64-linux/) there is only gtk2 in which there is almost nothing, and as I understand the functions, types, data structures and constants themselves are described in a slightly different place, which is called the source code. Here is my path to the source (/usr/share/fpcsrc/3.0.4/packages/) and there is also only a gtk2 folder in which gtk.pas and very little is written in it. In General, when I was figuring out where to get the functions themselves, constants, and so on. on some site I saw that one person says: It is necessary to download the source code of Pascal and look at the functions already described there (in fact, from there I learned about the source code) and threw a link to the source code of my version of FPC (3.0.4). I downloaded it and there is a gtk1 folder, in which everything is just described! But the question is why it is not in my source code in the system. If it should not be, then how to "install"this library. Please describe the solution to this problem in as much detail as possible, because I'm quite new)

--- End quote ---

When you install FPC on a Linux distribution it's installed precompiled, meaning that all units for the platform are available as object files which is all that is technically needed to correctly compile applications using these units. Especially to interface with third party libraries (like GTK is) the units are simple import units.

The source code of the FPC distribution is only required to look at the source code and to understand the functionality. Even if you don't want to write Lazarus applications, but directly GTK applications, it is recommended to use an IDE, because it highly helps with navigating the source code.

For directly writing GTK applications I suggest you to take a look at the examples in $fpcsrc/packages/gtk2/examples (where $fpcsrc is the directory where you have the source code for FPC). Also I suggest you not to use gtk1 one as that is already rather old. You should concentrate on gtk2 instead or even use the GTK3 bindings provided with Lazarus in $lazdir/lcl/interfaces/gtk2/gtk3bindings (though I don't know if they can be easily used outside of Lazarus).

yyttyy:
Thank u for the help! I understand that the fpc root directory contains precompiled files. But going to fpcsrc/packages/gtk2/examples there are examples,Yes , but where is the description of all functions, constants, and so on?

Navigation

[0] Message Index

[#] Next page

Go to full version