user59764: I would like to use the external libraries that are downloaded by Arduino IDE into the default sketchbook location (~/Arduino/libraries/).
If you open Library Manager in Arduino IDE and if you install an external library (e.g DHT sensor library 1.3.7 and its dependency Adafruit Unified Sensor 1.0.3) then it will be downloaded to the sketchbook location and you can use them freely in case of writing code in Arduino IDE.
However I really like auto code completion, managing source code in GIT repository, formatting source lines, etc. which functionalities are not provided by Arduino IDE, so I changed to CLion.
I have installed CLion and Arduino Support 1.4.4 Plugin and created a new Arduino Sketch Project.
Project Structure:
.
+--cmake
   +--Platform
      +--Arduino.cmake
   +--ArduinoToolchain.cmake
+--libs
   +--Adafruit_Sensor
      +--Adafruit_Sensor.h
      +--library.properties
      +--README.md
   +--DHT
      +--DHT.cpp
      +--DHT.h
      +--DHT_U.cpp
      +--DHT_U.h
      +--keywords.txt
      +--library.properties
      +--README.md
+--CMakeLists.txt
+--first_test_project.ino
+--User_Setup.h

first_test_project.ino:
#include <Arduino.h>
#include "User_Setup.h"
#include <libs/Adafruit_Sensor/Adafruit_Sensor.h>
#include <libs/DHT/DHT.h>

DHT *dht;

void setup() {
    dht = new DHT(7, DHT22);
}

void loop() {

}

So I have copied over the downloaded libraries from ~/Arduino/libraries folder to the project folder under libs folder.
When I try to upload the code to Arduino Board I am getting the following in the log:
undefined reference to `DHT::DHT(unsigned char, unsigned char, unsigned char)'

Could somebody please explain what is wrong here.
Thank you very much!

user62426: In my opinion, the easiest way for the beginner is to use Platformio, it sets up CLion project automatically.
See docs for more info.

59764: <p>I would like to use the external libraries that are downloaded by Arduino IDE into the default sketchbook location (<em>~/Arduino/libraries/</em>).</p>

<p>If you open Library Manager in Arduino IDE and if you install an external library (e.g <strong>DHT sensor library 1.3.7</strong> and its dependency <strong>Adafruit Unified Sensor 1.0.3</strong>) then it will be downloaded to the sketchbook location and you can use them freely in case of writing code in Arduino IDE.</p>

<p>However I really like auto code completion, managing source code in GIT repository, formatting source lines, etc. which functionalities are not provided by Arduino IDE, so I changed to CLion.</p>

<p>I have installed <strong>CLion</strong> and <strong>Arduino Support 1.4.4 Plugin</strong> and created a new Arduino Sketch Project.</p>

<h2>Project Structure:</h2>

<pre><code>.
+--cmake
   +--Platform
      +--Arduino.cmake
   +--ArduinoToolchain.cmake
+--libs
   +--Adafruit_Sensor
      +--Adafruit_Sensor.h
      +--library.properties
      +--README.md
   +--DHT
      +--DHT.cpp
      +--DHT.h
      +--DHT_U.cpp
      +--DHT_U.h
      +--keywords.txt
      +--library.properties
      +--README.md
+--CMakeLists.txt
+--first_test_project.ino
+--User_Setup.h
</code></pre>

<h2>first_test_project.ino:</h2>

<pre class="lang-c prettyprint-override"><code>#include &lt;Arduino.h&gt;
#include "User_Setup.h"
#include &lt;libs/Adafruit_Sensor/Adafruit_Sensor.h&gt;
#include &lt;libs/DHT/DHT.h&gt;

DHT *dht;

void setup() {
    dht = new DHT(7, DHT22);
}

void loop() {

}
</code></pre>

<p>So I have copied over the downloaded libraries from <em>~/Arduino/libraries</em> folder to the project folder under <em>libs</em> folder.</p>

<p>When I try to upload the code to Arduino Board I am getting the following in the log:</p>

<pre><code>undefined reference to `DHT::DHT(unsigned char, unsigned char, unsigned char)'
</code></pre>

<p>Could somebody please explain what is wrong here.</p>

<p>Thank you very much!</p>
 62426: <p>In my opinion, the easiest way for the beginner is to use Platformio, it sets up CLion project automatically.</p>

<p>See <a href="https://docs.platformio.org/en/latest/ide/clion.html" rel="nofollow noreferrer">docs</a> for more info.</p>
