gpt4 book ai didi

c++ - cmake:您已为没有任何源文件的库 cryptopp 调用了 ADD_LIBRARY

转载 作者:可可西里 更新时间:2023-11-01 10:18:29 25 4
gpt4 key购买 nike

Windows 64bit使用cmake编译c++项目:github.com/iHateInventNames/synergy-through-usb

我在这篇文章中修复了之前的一个问题:Compile issues: LIBUSB_1 with cmake project on Windows

因此,当我现在点击 cmake 时,出现以下错误:

> cmake .
-- Found libusb-1.0:
-- - Includes: C:/local/libs/libusbx
-- - Libraries: C:/local/libs/libusbx/libusb-1.0.lib
You have called ADD_LIBRARY for library cryptopp without any source files. This typically indicates a problem with your CMakeLists.txt file

-- Configuring done
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
CMake Error: CMake can not determine linker language for target: cryptopp
-- Generating done
-- Build files have been written to: C:/local/projects/synergy-usb/synergy-through-usb-master

这是什么意思?我该如何解决/继续?

安装说明链接

都转到 404 错误...

最佳答案

根据项目的 CMakeLists 的快速浏览,您似乎应该在运行之前将 tools/cryptopp562.zip 解压到名为 tools/cryptopp562 的目录中制作。如果有的话,这肯定应该在项目的安装说明中提到。

更准确地说,文件 tools/CMakeLists.txt 包含以下代码:

set(cpp_dir cryptopp562)

file(GLOB cpp_src ${cpp_dir}/*.cpp)

# ...

add_library(cryptopp STATIC ${cpp_src})

这意味着变量 cpp_src 填充了从目录 cryptopp562 中获取的源文件(相对于 CMakeList 的目录,即 tools),然后用于定义库 cryptopp 的源文件。但是,该项目的分发版仅包含 tools/cryptopp562.zip。将其解压缩到目录 tools/cryptopp562 中应该会提供丢失的文件。

关于c++ - cmake:您已为没有任何源文件的库 cryptopp 调用了 ADD_LIBRARY,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35480743/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com