GModule.Module.build_path
Description: Reference for GModule.Module.build_path

### Function

# GModule Modulebuild_path

deprecated: 2.76

#### Declaration [src]

    gchar*
    g_module_build_path (
      const gchar* directory,
      const gchar* module_name
    )

#### Description [src]

A portable way to build the filename of a module. The platform-specific prefix and suffix are added to the filename, if needed, and the result is added to the directory, using the correct separator character.

The directory should specify the directory where the module can be found. It can be `NULL` or an empty string to indicate that the module is in a standard platform-specific directory, though this is not recommended since the wrong module may be found.

For example, calling `g_module_build_path()` on a Linux system with a `directory` of `/lib` and a `module_name` of “mylibrary” will return `/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the directory it will return `\Windows\mylibrary.dll`.

Deprecated since: 2.76

Use `g_module_open()` instead with `module_name` as the basename of the file_name argument. See `G_MODULE_SUFFIX` for why.

#### Parameters

`directory`

  Type: `const gchar*`

  The directory where the module is. This can be `NULL` or the empty string to indicate that the standard platform-specific directories will be used, though that is not recommended.

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`module_name`

  Type: `const gchar*`

  The name of the module.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `gchar*`

The complete path of the module, including the standard library prefix and suffix. This should be freed when no longer needed.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.