1

Recently I start to learn about machine learning and download a library that work with it: GEGELATI for C++, in Visual Studio. Link to the library: https://github.com/gegelati/gegelati. I also download the example "stick-game" from the same page. I follow all the points to build the library and the example, but it throw an error: "can't find gegelati.h". When I saw that, I remember the advice the "cmake .." command gave me when I build the library in the project:

*CMake Warning at CMakeLists.txt:68 (find_package):
  By not providing "FindGEGELATI.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "GEGELATI",
  but CMake did not find one.

Could not find a package configuration file provided by "GEGELATI" with any of the following names:

GEGELATIConfig.cmake
gegelati-config.cmake

Add the installation prefix of "GEGELATI" to CMAKE_PREFIX_PATH or set "GEGELATI_DIR" to a directory containing one of the above files. If "GEGELATI" provides a separate development package or SDK, be sure it has been installed.*

If you need to know, this is the code in my CMakeList.txt: https://drive.google.com/file/d/1hDkC6coCWaQNb1Cv1QzrJbUMucjYE68y/view?usp=sharing

To solve the problem, I decided to copy the gegelati.h and GEGELATIConfig.cmake files (from the folder where I installed gegelati), but when I tried to compile again, the error E1696 showed up; it can't open gegelati.h.

Finally, I tried to put the gegelati files directly in the "stick-game/lib/gegelatilib" folder and include its path in the "AdditionalIncludeDirectories". I put an image about this (sorry, it is in Spanish):

AdditionalIncludeDirectory

The new program output throw me 19 'LNK2019' errors and 8 'LNK2001' errors. Example of two:

Error  LNK2019  símbolo externo "public: unsigned int __thiscall Instructions::Set::getNbInstructions(void)const " (?getNbInstructions@Set@Instructions@@QBEIXZ) sin resolver al que se hace referencia en la función _main

Error   LNK2001 símbolo externo "public: virtual class Learn::LearningEnvironment * __thiscall Learn::LearningEnvironment::clone(void)const " (?clone@LearningEnvironment@Learn@@UBEPAV12@XZ) sin resolver

Also, at the beginning, when I install doxygen for use gegelati, it throws some errors:

*Checking Build System
  Generating doxygen documentation in C:/Users/Acel Guilts/gegelati/bin/doc
CUSTOMBUILD : warning : tag INPUT: input source 'C:/Users/Acel' does not exist [C:\Users\Acel Guilts\gegelati\bin\doc\d
oc.vcxproj]
CUSTOMBUILD : warning : tag INPUT: input source 'Guilts/gegelati/gegelatilib' does not exist [C:\Users\Acel Guilts\gege
lati\bin\doc\doc.vcxproj]
CUSTOMBUILD : warning : tag INPUT: input source 'C:/Users/Acel' does not exist [C:\Users\Acel Guilts\gegelati\bin\doc\d
oc.vcxproj]
CUSTOMBUILD : warning : tag INPUT: input source 'Guilts/gegelati/doc' does not exist [C:\Users\Acel Guilts\gegelati\bin
\doc\doc.vcxproj]
CUSTOMBUILD : error : source C:/Users/Acel is not a readable file or directory... skipping. [C:\Users\Acel Guilts\gegel
ati\bin\doc\doc.vcxproj]
CUSTOMBUILD : error : source Guilts/gegelati/gegelatilib is not a readable file or directory... skipping. [C:\Users\Ace
l Guilts\gegelati\bin\doc\doc.vcxproj]
CUSTOMBUILD : error : source C:/Users/Acel is not a readable file or directory... skipping. [C:\Users\Acel Guilts\gegel
ati\bin\doc\doc.vcxproj]
CUSTOMBUILD : error : source Guilts/gegelati/doc is not a readable file or directory... skipping. [C:\Users\Acel Guilts
\gegelati\bin\doc\doc.vcxproj]*

Do you have any idea about how to solve the problem?

albert
  • 8,285
  • 3
  • 19
  • 32

2 Answers2

2

The installation process of GEGELATI for the latest version of Microsoft Visual Studio on Windows (x64) can be done with the following steps:

  1. Download the application of your choice from the GEGELATI-APPS repository (or any other application built with the library).

  2. Download the latest binary of the GEGELATI library from here. Make sure to select the gegelatilib-x.y.z.zip at the bottom of the page.

  3. Unzip the content of gegelatilib-x.y.z.zip into the lib folder of your application. For example, for the stick-game application, the folder will be stick-game/lib/gegelatilib-0.2.1, and it should contain the following subfolders: bin, CMake, doc, include, lib.

  4. Open a terminal in the stick-game/bin folder, and simply type:

      cmake ..
    

    This should produce the following output:

    -- Building for: Visual Studio 16 2019
    -- Selecting Windows SDK version 10.0.18362.0 to target Windows 6.1.7601.
    -- The C compiler identification is MSVC 19.26.28806.0
    -- The CXX compiler identification is MSVC 19.26.28806.0
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    Copy GEGELATI DLLs into <YOUR_PATH>/stick-game/bin
    -- Configuring done
    -- Generating done
    -- Build files have been written to: <YOUR_PATH>/stick-game/bin
    
  5. Now you can open the project by opening the stick-game/bin/stick-game.sln solution. To launch the application from Visual Studio, right-click on the stick-game project in the Solution Explorer and select Set as Startup Project.

Alternatively

  1. Still in the terminal, from the bin directory:
    cmake --build . --target stick-game --config Release
    
    Then
    .\Release\stick-game.exe
    

Best,

Karol

0
  1. Download GEGELATI here and generate it Cmake solution
  2. Download stick-game Project here and generate it Cmake solution
  3. Add path of gegelati.h to Additional include directories. In my case G:\CMake\Sources\gegelati-master\gegelatilib\include\ (a better solution is to use relative path with ../../.. but it is not our problem)

enter image description here

  1. Check that you edit for current configuration (see red arrow)
  2. Find path of the generated GEGELATI libraries, in my case : G:\CMake\Build\gegelati\lib\Debug

enter image description here
6. Add this path (G:\CMake\Build\gegelati\lib\Debug) to Additional library Directories

enter image description here

  1. Add gtestd.lib and GEGELATId.lib in input:

enter image description here

  1. It should be good now!

enter image description here

Landstalker
  • 1,368
  • 8
  • 9