---
name: "memcached_version"
section: "3"
platform: "linux"
package: "libmemcached-awesome"
version: "1.1.4-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/memcached_version"
---

# memcached\_version(3)

libmemcached Documentation

## NAME

memcached\_version - libmemcached Documentation

## SYNOPSIS

- **#include \<libmemcached/memcached.h\>**

  Compile and link with -lmemcached

- **const char \*memcached\_lib\_version(void)**

  - **Returns**

    version string of **libmemcached**

- **memcached\_return\_t \<#\_CPPv418memcached\_return\_t\> memcached\_version(memcached\_st \<#\_CPPv412memcached\_st\> \*ptr)**

  - **Parameters**

    **ptr** -- pointer to initialized **memcached\_st** \<#\_CPPv412memcached\_st\> struct

  - **Returns**

    **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> indicating success

## DESCRIPTION

**memcached\_lib\_version()** is used to return a simple version string representing the **libmemcached** version (client library, not server).

**memcached\_version()** is used to set the major, minor, and micro versions of each memcached server being used by the **memcached\_st** \<#\_CPPv412memcached\_st\> connection structure. It returns the memcached server return code.

## RETURN VALUE

**memcached\_lib\_version()** returns a string with the version of the libmemcached driver.

A value of **memcached\_return\_t** \<#\_CPPv418memcached\_return\_t\> is returned from :func:'memcached\_version'

On success that value will be **MEMCACHED\_SUCCESS** \<#\_CPPv4N18memcached\_return\_t17MEMCACHED\_SUCCESSE\>.

If called with the **MEMCACHED\_BEHAVIOR\_USE\_UDP** \<#\_CPPv4N20memcached\_behavior\_t26MEMCACHED\_BEHAVIOR\_USE\_UDPE\> behavior set, the value **MEMCACHED\_NOT\_SUPPORTED** \<#\_CPPv4N18memcached\_return\_t23MEMCACHED\_NOT\_SUPPORTEDE\> will be returned.

Use **memcached\_strerror()** \<#\_CPPv418memcached\_strerrorP12memcached\_st18memcached\_return\_t\> to translate this value to a printable string.

## SEE ALSO

**[memcached(1)](/memcached/1.md) \<https://linux.die.net/man/1/memcached\>** **[libmemcached(3)](/libmemcached/3.md) \<https://linux.die.net/man/3/libmemcached\>** **[memcached\_strerror(3)](/memcached_strerror/3.md) \<https://linux.die.net/man/3/memcached\_strerror\>**
