字符串模糊匹配库 FuzzyWuzzy 的 Mingw 编译过程

本人参阅:【开发环境】Windows10配置mingw环境变量

本人参阅:Win10 + CMake + MinGW 简单使用

访问:pypi.org  搜索 fuzzywuzzy

访问:fuzzywuzzy · PyPI

用鼠标滚动网页到底部,可见: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

本篇是本人练习笔记,仅供同学参考。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值