freetype_opencv icon indicating copy to clipboard operation
freetype_opencv copied to clipboard

编译错误

Open RoseInTheHand opened this issue 4 years ago • 8 comments

std::max 未找到匹配的重载函数

RoseInTheHand avatar Nov 19 '20 02:11 RoseInTheHand

std::max 未找到匹配的重载函数

https://en.cppreference.com/w/cpp/algorithm/max 看一下这个,可能没有添加 algorithm 头文件。如果是在 windows 平台的话,也可以直接使用宏 max,把 std:: 去掉。 另外也可以试试吧 std::max() 的参数类型显示转换为一致试试。

busyboxs avatar Nov 19 '20 04:11 busyboxs

再不行就用 if..else..吧

busyboxs avatar Nov 19 '20 04:11 busyboxs

第一种方法我试过了,在windows平台有问题,不过注释了之后可运行,我用if else 试下

RoseInTheHand avatar Nov 19 '20 04:11 RoseInTheHand

嗯嗯,还是用if else,谢谢大佬

RoseInTheHand avatar Nov 19 '20 04:11 RoseInTheHand

大佬你这字体怎么和opencv自带的不太一样啊

RoseInTheHand avatar Nov 19 '20 06:11 RoseInTheHand

大佬你这字体怎么和opencv自带的不太一样啊

字体可以指定,windows自带的那些字体应该都能用,你得把字体文件放进font目录

busyboxs avatar Nov 19 '20 08:11 busyboxs

这个我知道,但是显示的时候就是有点奇怪,我想让字体没有那么多效果,效果太多了,正常显示就行,改了参数,不太理想

RoseInTheHand avatar Nov 19 '20 09:11 RoseInTheHand

模板类型不匹配,改一下类型 m_maxDiffHeight = std::max(m_maxDiffHeight, rows - (slot->metrics.vertBearingY >> 6)); => m_maxDiffHeight = std::max(m_maxDiffHeight, (long)(rows - (slot->metrics.vertBearingY >> 6)));

njuFerret avatar Sep 14 '23 01:09 njuFerret