本人参阅:【开发环境】Windows10配置mingw环境变量
本人参阅:Win10 + CMake + MinGW 简单使用
访问:pypi.org 搜索 fuzzywuzzy
用鼠标滚动网页到底部,可见:C++: Tmplt/fuzzywuzzy
下载 fuzzywuzzy-master.zip 后解压到当前目录。
test/main.cpp 如下
#include <iostream>
#include "fuzzywuzzy.hpp"
#include "process.hpp"
int main()
{
const string a = "I'm in your mind", b = "I'm in your mind fuzz";
const string c = "fuzzy wuzzy was a bear", d = "wuzzy fuzzy was a bear";
std::cout << fuzz::ratio(a, b) << '\n';
std::cout << fuzz::partial_ratio(a, b) << '\n';
std::cout << fuzz::token_sort_ratio(c, d) << '\n';
std::vector<string> v = {"fuzzy", "wuzzy", "wuzzy", "fuzzy", "fuzzy", " "};
auto erg = fuzz::dedupe(v);
}
mingw32-make --version
这个时候 make 实际上存在,但是名称为: mingw32-make.exe
复制一份 copy mingw32-make.exe make.exe 或者 copy gmake.exe make.exe
cd D:\Cs\fuzzywuzzy-master
mkdir build
cmake -G "MinGW Makefiles" -B ./build
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Strawberry/c/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/Strawberry/c/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type: Release
-- Configuring done (4.0s)
-- Generating done (0.0s)
-- Build files have been written to: D:/Cs/fuzzywuzzy-master/build
cd build
make
[ 10%] Building C object src/CMakeFiles/levenshtein.dir/levenshtein.c.obj
[ 20%] Linking C static library liblevenshtein.a
[ 20%] Built target levenshtein
[ 30%] Building CXX object src/CMakeFiles/fuzzywuzzy.dir/fuzzywuzzy.cpp.obj
[ 40%] Building CXX object src/CMakeFiles/fuzzywuzzy.dir/process.cpp.obj
[ 50%] Building CXX object src/CMakeFiles/fuzzywuzzy.dir/string_matcher.cpp.obj
[ 60%] Building CXX object src/CMakeFiles/fuzzywuzzy.dir/utils.cpp.obj
[ 70%] Building CXX object src/CMakeFiles/fuzzywuzzy.dir/wrapper.cpp.obj
[ 80%] Linking CXX shared library ..\bin\libfuzzywuzzy.dll
[ 80%] Built target fuzzywuzzy
[ 90%] Building CXX object test/CMakeFiles/main.dir/main.cpp.obj
[100%] Linking CXX executable ..\bin\main.exe
[100%] Built target main
cd D:\Cs\fuzzywuzzy-master\build\bin
dir
运行 main.exe
本篇是本人练习笔记,仅供同学参考。