使用外部库(GEGELATI)时出现的问题 最近我开始学习机器学习,并下载一个与之相关的库:VisualStudio中的GeelaTeaC++。指向库的链接:。我还从同一页面下载了示例“棍棒游戏”。我遵循所有要点来构建库和示例,但它抛出了一个错误:“找不到gegelati.h”。当我看到这一点时,我记得在项目中构建库时“cmake..”命令给我的建议: *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.

使用外部库(GEGELATI)时出现的问题 最近我开始学习机器学习,并下载一个与之相关的库:VisualStudio中的GeelaTeaC++。指向库的链接:。我还从同一页面下载了示例“棍棒游戏”。我遵循所有要点来构建库和示例,但它抛出了一个错误:“找不到gegelati.h”。当我看到这一点时,我记得在项目中构建库时“cmake..”命令给我的建议: *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.,c++,visual-studio,dll,cmake,doxygen,C++,Visual Studio,Dll,Cmake,Doxygen,找不到“GEGELATI”提供的包含任何 下列姓名中: GEGELATIConfig.cmake gegelati-config.cmake 将安装前缀“GEGELATI”添加到CMAKE_prefix_路径或集合中 “GEGELATI_DIR”指向包含上述文件之一的目录。如果 “GEGELATI”提供了一个单独的开发包或SDK,请确保它 已安装* 如果您需要知道,这是my CMakeList.txt中的代码: 为了解决这个问题,我决定复制gegelati.h和GEGELATIConfig.c

找不到“GEGELATI”提供的包含任何 下列姓名中:

GEGELATIConfig.cmake
gegelati-config.cmake
将安装前缀“GEGELATI”添加到CMAKE_prefix_路径或集合中 “GEGELATI_DIR”指向包含上述文件之一的目录。如果 “GEGELATI”提供了一个单独的开发包或SDK,请确保它 已安装*

如果您需要知道,这是my CMakeList.txt中的代码:

为了解决这个问题,我决定复制gegelati.h和GEGELATIConfig.cmake文件(从我安装gegelati的文件夹中),但当我再次尝试编译时,出现了错误E1696;它无法打开gegelati.h

最后,我尝试将gegelati文件直接放在“stick game/lib/gegelatilib”文件夹中,然后 将其路径包含在“AdditionalIncludeDirectories”中。我放了一张图片(对不起,是西班牙语):

新程序输出向我抛出19个“LNK2019”错误和8个“LNK2001”错误。两个例子:

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
另外,在开始时,当我安装doxygen以使用gegelati时,它会抛出一些错误:

*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]*
你知道如何解决这个问题吗

  • 下载
    GEGELATI
    并生成它的Cmake解决方案
  • 下载
    棍棒游戏项目
    并生成它的Cmake解决方案
  • gegelati.h
    的路径添加到
    其他包含目录
    。在我的例子中,
    G:\CMake\Sources\gegelati master\gegelatilib\include\
    (更好的解决方案是使用相对路径,
    。/../..
    ,但这不是我们的问题)
  • 检查您是否编辑了当前配置(请参见红色箭头)
  • 查找生成的
    GEGELATI
    库的路径,在我的示例中:
    G:\CMake\Build\GEGELATI\lib\Debug

  • 6.将此路径(
    G:\CMake\Build\gegelati\lib\Debug
    )添加到
    其他库目录

  • 在输入中添加gtestd.libGEGELATId.lib
  • 现在应该好了

    可通过以下步骤完成Windows(x64)上最新版本Microsoft Visual Studio的
    GEGELATI
    安装过程:

  • 从下载您选择的应用程序(或使用库构建的任何其他应用程序)

  • 从下载
    GEGELATI
    库的最新二进制文件。确保选择页面底部的
    gegelatilib-x.y.z.zip

  • gegelatilib-x.y.z.zip的内容解压缩到应用程序的
    lib
    文件夹中。例如,对于
    stick game
    应用程序,文件夹将是
    stick game/lib/gegelatilib-0.2.1
    ,它应该包含以下子文件夹:
    bin
    CMake
    doc
    include
    lib

  • 棍棒游戏/bin
    文件夹中打开一个终端,只需键入:

    cmake。。
    
    这将产生以下输出:

    -- 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
    
    然后
  • 最好的

    卡罗尔

    cmake --build . --target stick-game --config Release
    
    .\Release\stick-game.exe