Creating libraries

I have written a code that uses several procedures. I know that copying the procedures into the code works fine, but I'd like to use the procedures for other codes as well. Thus I created some libraries according to the types of procedure, and then at the beginning of the code I just write library and then the names of the libraries. For this to work, I need to copy the procedures (I've given them a .src extension) to the src folder of Gauss, right? Or is there an easier way to deal with these procedures?

2 Answers


  1. For files that are included in a library, the file extension is not required to be .fext. It can be anything. .src is a fine file extension for you to use, but you have options.

  2. For the library to find the files listed in the .lcg file (the library file), either the source files must be in the GAUSS source path, or the library file must have full-path references to the files.
  • The Library Tool Window has a node towards the top named 'Paths'. If you expand this node, you will see the GAUSS source paths listed.

  • You can add full paths to a library file with the command
lib my_library -addpath
  1. You can add extra folders to your GAUSS source path in the gauss.cfg file and by using one of the cases of the sysstate command.

  2. If you lay all the files out in a set of directories (only src and lib would be required), with the source files in src and a library file WITHOUT full path, and create a zip file of this, then the GAUSS applications installer can be used to extract these files. There is also an unpublished specification for an XML file you can make in place of a library and the GAUSS applications installer will create a library from this file.

  3. You can also create files with the name, the same as the procedure in the file and a .g file extension. If these are all in the same directory and it is your GAUSS working directory, GAUSS will find them.

  4. GAUSS 18, scheduled to be released today has a more sophisticated package management system which allows each library to have it's own package directory to keep things separate and these package directories are automatically added to the GAUSS source path.


Thanks a lot for the detailed explanations.

I know that Gauss doesn't care much about the extension, and I've chosen the .src extension because then it's clear that it is not a code. It seems to me that the easiest thing is to copy the procedures into the src folder of Gauss, although then I need to recreate the library files (or edit them directly).

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy