.. _Linking_Library: 1.2.3 Linking Library ------------------------------------------ .. note:: Including the DRFL header also brings the declaration ``using namespace std;`` into the including file (from ``DRFS.h``). Names in your code that match ``std`` names (for example ``byte``, ``list``, ``count``) can then become ambiguous; qualify them or include the DRFL header only in source files that need it. Linux Library ~~~~~~~~~~~~~~~~~~~~~ Create a file with a .conf extension (e.g., DRFLib.conf) in the /etc/ld.so.conf.d/ directory, add the *.so* file path to the file, and register the library by executing the ldconfig command. The following example describes how to register and link the **DRFL library** in a Linux environment. Actual installation paths may vary depending on the user's workspace and Linux distribution. .. note:: The library installation path may differ depending on your workspace or system configuration. When creating the ``.conf`` file, specify the **actual directory path** where the DRFL and Poco libraries are located. .. code-block:: bash :linenos: ## 1. Verify the library path # Make sure the directory contains libDRFL, libPocoFoundation.so, and libPocoNet.so. ls /home//API-DRFL/library/Linux/64bits/amd64/{your_ubuntu_version} ## 2. Add a .conf file under /etc/ld.so.conf.d/ # Replace the path below with your actual library directory. sudo nano /etc/ld.so.conf.d/drfl.conf # Add the following single line to the file, then save and exit: /home//API-DRFL/library/Linux/64bits/amd64/{your_ubuntu_version} ## 3. Register the library sudo ldconfig ## 4. Build a sample C++ file # Specify the proper include and library directories. g++ test.cpp -o test \ -I/home//API-DRFL/include \ -L/home//API-DRFL/library/Linux/64bits/amd64/{your_ubuntu_version} \ -lDRFL -lPocoNet -lPocoFoundation -lpthread Windows Library ~~~~~~~~~~~~~~~~~ Both Windows DLLs are MinGW builds. DRFLWin32.dll needs PocoFoundation.dll and PocoNet.dll next to it; DRFLWin64.dll needs PocoFoundation64.dll and PocoNet64.dll next to it. The project settings for using this API in a C++ project are as follows. - **Setting of header file (include)** ``[Configuration Properties]->[C/C++]->[General]->[Additional Include Directories]`` .. image:: /tutorials/images/introduction/linking_window_attribute.png :alt: linking_window_attribute :width: 50% :align: center .. raw:: html

.. image:: /tutorials/images/introduction/linking_window_c++.png :alt: linking_window_c++ :width: 100% :align: center .. raw:: html
- **Setting of library (lib) path** ``[Configuration Properties]->[Linker]->[General]->[Additional Library Directories]`` .. image:: /tutorials/images/introduction/linking_window_linker.png :alt: linking_window_c++ :width: 100% :align: center