---
name: "im_guess_libdir"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_guess_prefix"
---

# im\_guess\_libdir(3)

try to guess install directory

Part of [im\_guess\_prefix(3)](/im_guess_prefix/3.md).

## NAME

im\_guess\_prefix, im\_guess\_libdir - try to guess install directory

## SYNOPSIS

**#include \<vips/vips.h\>**

**const char \*im\_guess\_prefix( const char \*argv0,** **const char \*env\_name )**

**const char \*im\_guess\_libdir( const char \*argv0,** **const char \*env\_name )**

## DESCRIPTION

**[im\_guess\_prefix(3)](/im_guess_prefix/3.md)** tries to guess the install directory. You should pass in the value of argv\[0\] (the name your program was run as) as a clue to help it out, plus the name of the environment variable you let the user override your package install area with (eg. "VIPSHOME").

On success,  **[im\_guess\_prefix(3)](/im_guess_prefix/3.md)** returns the prefix it discovered, and as a side effect, sets the environment variable (if it's not set).

**[im\_guess\_prefix(3)](/im_guess_prefix/3.md)** is useful for programs in the VIPS distribution and contrib which need to be able to find data files.

Don't free the return string!

**[im\_guess\_libdir(3)](/im_guess_libdir/3.md)** works exactly as  **[im\_guess\_prefix(3)](/im_guess_prefix/3.md)** but, if vips has not been moved since configure, returns the libdir configure setting. If vips has been moved, it returns prefix/lib.

## RETURN VALUE

The function returns NULL on failure.
