There are two ways to access the C and C++ interface:
This way requires that you link with an API library, and works under all circumstances. If no experiment is active, the API calls are ignored.
This way works when used in the main executable, and when data collection is started at the same time the program starts. This way does not always work when dbx is used to attach to the process, nor when used from within a shared library that is dlopen’d by the process. This second way is provided for backward compatibility only, and its use is discouraged for any other purpose.
Do not link a program in any language with -lcollector. If you do, the Collector can exhibit unpredictable behavior.