[Gambas-user] Creating a library....

Christof Thalhofer chrisml at deganius.de
Sun Jun 10 20:24:21 CEST 2018


Am 10.06.2018 um 17:10 schrieb Demosthenes Koptsis:
> Hello, i want to port to gambas the libc library, so i decided to create 
> a library project.
> 
> i have some questions...
> 
> 1) First i created a new project as a command line project
> 
> 2) i added a module file for all Public Extern functions, named gbLibc
> 
> 3) i have also a Main module for testing purposes.
> 
> i want to ask when a choose from project properties "Library" as project 
> type, i need the Main module?

No.

> Or before i compile the project i need to remove the Main module and 
> have only the gbLibc module?
> 
> How i must setup the project to create a library?

Flag the project as library and give it a vendor name.

Every class or module that has to bee seen from outside (in other
projects) must contain the word "Export" in the beginning.

Only public methods can be used in other projects.

If it is compiled, the IDE will install it locally in the dir

~/.local/share/gambas3/lib/vendorname

From now on you can see it in the library tab of the project dialog of
other projects.

In other projects that will rely on the lib every exported class or
module will be seen and can be accessed as

Classname.PublicMethod(...)

If cou create an installation package for a Linux distro then the
library will be installed in

/usr/lib/gambas3/vendorname

Alles Gute

Christof Thalhofer

-- 
Dies ist keine Signatur

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180610/d4405124/attachment-0001.sig>


More information about the User mailing list