mlpack include file errors

Recently I am about to learn mlpack. Today I have successfully built the solution from mlpack source code, but when I newly create a project I get the following error in the header file. I would like to know what is wrong and how to fix it.

errors

In the screenshot, the algorithm.hpp is under the build folder and its absolute path is D:\MLPack\mlpack\build\include\mlpack\core\std_backport\algorithm.hpp. The source code in the new project is just a copy from https://www.mlpack.org/.

The screenshot below shows some of the files generated after building solution of mlpack.sln.

generated libs

The versions of other libraries to help build the mlpack are :

Armadillo      10.8.0 (at least 9.800)
Boost (math_c99, spirit) 1.78.0 (at least 1.58.0, and I have added this version string in  CMakeLists.txt before building mlpack)
CMake          3.20 (at least 3.6)
ensmallen      2.18.1 (at least 2.10.0)
cereal         1.3.0 (at least 1.1.2)
openBLAS       0.24.1

The configurations of my new project are shown below.

additional include directories

additional dependencies

post-build event

And I have also disabled "Conformance Mode".

disabled conformance mode

The entire building and using process refer to https://www.mlpack.org/doc/stable/doxygen/build_windows.html and https://www.mlpack.org/doc/mlpack-3.4.2/doxygen/sample_ml_app.html.


Solution 1:

I finally found out that this problem seems to be related to the version of the source code. I should not use the latest version of the source code from https://github.com/mlpack/mlpack, but the source code corresponding to the latest stable version. After I replaced the include directory with the include directory corresponding to the officially released windows installation package, no error was reported during the building of the solution in my new project, so I got the expected result.

the result

This incident taught me a lesson that I should use the stable rather than the latest version of the source code when doing CMake in the future.