# error_code load(char const * path[],int min_ver = TBB_INTERFACE_VERSION, int max_ver = INT_MAX)

## Requirements

The last element of `path[]` must be `NULL`.

## Effects

Load a suitable version of an Intel® Threading Building Blocks (Intel® TBB) dynamic library from one of the specified directories.

### Tip

The method searches for a library in directories specified in the `path[]` array. When a library is found, it is loaded and its interface version (as returned by `TBB_runtime_interface_version())` is checked. If the version does not meet the requirements specified by `min_ver` and `max_ver`, the library is unloaded. The search continues in the next specified path, until a suitable version of the Intel® TBB library is found or the array of paths ends with `NULL`. It is recommended to use default values for `min_ver` and `max_ver`.

### Caution

For security reasons, avoid using relative directory names such as current ("."), parent ("..") or any other relative directory (like "lib") when searching for a library. Use only absolute directory names (as shown in the example above); if necessary, construct absolute names at run time. Neglecting these rules may cause your program to execute 3-rd party malicious code. (See http://www.microsoft.com/technet/security/advisory/2269637.mspx for details.)

## Returns

`ec_ok` - a suitable version was successfully loaded.

`ec_bad_call` - this runtime_loader instance has already been used to load a library.

`ec_bad_lib` - A library was found but it appears invalid.

`ec_bad_arg` - min_ver and/or max_ver is negative or zero, or min_ver > max_ver.

`ec_bad_ver` - unsuitable version has already been loaded by another instance.

`ec_no_lib` - No suitable version was found.

Parent topic: runtime_loader Class