在Visual Studio上创建Google的CRC32C
Creating Google's CRC32C on Visual Studio
正如标题所说。 我正在尝试编译在Google的Github上找到的代码。 我对CMake了解不多。 首先,我按照说明运行以下命令:
git submodule update --init --recursive
我收到以下错误消息:fatal: not a git repository (or any of the parent directories): .git
。 之后,我尝试运行以下构建命令:
cmake -DCRC32C_BUILD_TESTS=0 -DCRC32C_BUILD_BENCHMARKS=0 .. && make all install
输出如下所示:
l install
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.22.27905.0
-- The CXX compiler identification is MSVC 19.22.27905.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/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.22.27905/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/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
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test CRC32C_HAVE_NO_DEPRECATED
-- Performing Test CRC32C_HAVE_NO_DEPRECATED - Failed
-- Performing Test CRC32C_HAVE_NO_SIGN_COMPARE
-- Performing Test CRC32C_HAVE_NO_SIGN_COMPARE - Failed
-- Performing Test CRC32C_HAVE_NO_UNUSED_PARAMETER
-- Performing Test CRC32C_HAVE_NO_UNUSED_PARAMETER - Failed
-- Performing Test CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS - Failed
-- Performing Test HAVE_BUILTIN_PREFETCH
-- Performing Test HAVE_BUILTIN_PREFETCH - Failed
-- Performing Test HAVE_MM_PREFETCH
-- Performing Test HAVE_MM_PREFETCH - Success
-- Performing Test HAVE_SSE42
-- Performing Test HAVE_SSE42 - Success
-- Performing Test HAVE_ARM64_CRC32C
-- Performing Test HAVE_ARM64_CRC32C - Failed
-- Performing Test HAVE_STRONG_GETAUXVAL
-- Performing Test HAVE_STRONG_GETAUXVAL - Failed
-- Performing Test HAVE_WEAK_GETAUXVAL
-- Performing Test HAVE_WEAK_GETAUXVAL - Failed
CMake Error at CMakeLists.txt:184 (add_subdirectory):
The source directory
C:/Source/crc32c-master/third_party/glog
does not contain a CMakeLists.txt file.
-- Configuring incomplete, errors occurred!
See also "C:/Source/crc32c-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Source/crc32c-master/build/CMakeFiles/CMakeError.log".
我查看了错误日志,但没有得到太多帮助。 third_party/glog 目录是空的,所以没有任何CMakeLists.txt
文件,就像应该有的那样。 (/third_party 下的/benchmark 和/googletest 子目录也是空的。
有没有人使用Visual Studio成功构建了这个? 如果是这样,如何?
我认为这并不重要,但我使用的是VS2019社区版16.2.5和CMake 3.15.2。 蒂亚。
Alan Birtles给了我正确的答案。
我刚刚下载了.zip文件,当时我需要对文件进行git clone
。 在那之后,一切都像预期的那样工作。 非常感谢艾伦·伯特尔斯。
相关文章:
- 如何使用Google Mock来模拟gettimeofday()
- 在Google Kick start中提交时出错
- CHECK(调用)函数在Google Colab中出错
- Google protobuf 时间戳未声明标识符,在 Windows 上具有C++
- 如何使用 Google Test 向测试添加元数据 / 如何将数据从 Google Test 发送到 TestEven
- 在macOS Mojave上发布BOOST unit_test_framework/Google测试
- Google Test for OpenCv c++
- 使用 Google Test 对自定义断言函数进行单元测试
- Google Cloud Pubsub Async Streaming API in C++
- 如何在Google Cloud Functions上运行C++文件?
- 在jupyter notebook和google colab中使用.so
- gmock / google-mock发出警告,并且通过模拟异常未通过测试
- Google Or-Tools Glop:如何创建指向 const 对象的指针数组?
- 如何读取 google::p rotobuf::io::CodedOutputStream::WriteVarint32
- Google Sparsehash 在类型上使用 realloc(),这很难复制
- 如何在 google test in windows 中管理断言
- CMake 在编译 Google 的 protobuf 示例时找不到 protobuf
- google test PrintTo for std::set<std::string>
- Google Colab 看不到 .so 文件
- 在Visual Studio上创建Google的CRC32C