Error LNK2019 with Alglib library with VS2019 and c++ [duplicate]

  alglib, c++, compiler-errors, visual-studio-2019

I have downloaded the Alglib library and I have created a Console Application with VS2019, then under Project->proprieties->C/C++->General->Additional include directories I added the path to the src directory of Alglib containing the .h and .cpp files.

My main is as simple as this:

#include <iostream>
#include "interpolation.h"
int main()
{
   alglib::real_1d_array x;
   std::cout << "Hello World!n";
}

But when I compile, I get this errors:

1>ConsoleApplication2.obj : error LNK2019: riferimento al simbolo esterno "public: __thiscall alglib::real_1d_array::real_1d_array(void)" ([email protected]@@[email protected]) non risolto nella funzione _main

1>ConsoleApplication2.obj : error LNK2019: riferimento al simbolo esterno "public: virtual __thiscall alglib::real_1d_array::~real_1d_array(void)" ([email protected]@@[email protected]) non risolto nella funzione _main

1>C:UsersmattisourcereposConsoleApplication2DebugConsoleApplication2.exe : fatal error LNK1120: 2 esterni non risolti

1>Compilazione progetto "ConsoleApplication2.vcxproj" NON COMPLETATA.

What am I doing wrong?

Source: Windows Questions C++

LEAVE A COMMENT