Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Function program_location

boost::dll::program_location

Synopsis

// In header: <boost/dll/runtime_symbol_info.hpp>


boost::filesystem::path program_location(boost::system::error_code & ec);
boost::filesystem::path program_location();

Description

On success returns full path and name of the currently running program (the one which contains the `main()` function).

Return value can be used as a parameter for shared_library. See Tutorial "Linking plugin into the executable" for usage example. Flag '-rdynamic' must be used when linking the plugin into the executable on Linux OS.

Parameters:

ec

Variable that will be set to the result of the operation.

Throws:

std::bad_alloc in case of insufficient memory. Overload that does not accept boost::system::error_code also throws boost::system::system_error.

PrevUpHomeNext