How to enable Armadillo in CLion (without false errors)?

When I use the Armadillo C ++ library in CLion , the IDE indicates (highlights) a few (false) errors in the code, however using Armadillo does and the code builds and works without errors.

For example, in a very simple test project, the Armadillo IDE indicates 3 errors, as written in the comments:

#include <iostream> #include "armadillo" using namespace std; using namespace arma; int main() { cout << "Armadillo version: " << arma_version::as_string() << endl; // Returns 5.0.1 (Ankle Biter) mat A(2,3); // Error: Too many arguments, expected 0 A.fill(99); A(1,2) += 101.0; // Error: Called object is not a function A.print("A = "); A.set_size(4,5); // Error: Too many arguments, expected 1 A.fill(77); A.print("A = "); return 0; } 

Since Armadillo has only a title, I did not change the default CMakeLists.txt file, included only the main title in main.cpp and copied armadillo_bits into the project directory.

I tried to configure Armadillo on CMake, but on Windows it seems that Armadillo in the CMakeLists.txt bundle just copies the inbox and creates config.hpp in my working directory.

Is there a way to index characters in libraries for headings only?

CLION version 1.0 (141.353), Armadillo version 5.0.1. My platform is Windows 8.1 x64 and I am using MinGW v64 4.9.2 (x86_64-4.9.2-win32-seh-rt_v4-rev2)

The CLion project is available in this repository .

Thanks for trying to investigate this issue.

+6
source share

Source: https://habr.com/ru/post/986072/


All Articles