【发布时间】:2021-07-27 16:20:29
【问题描述】:
我在 Windows 中编译了相同的代码(MozJpeg 项目 https://github.com/mozilla/mozjpeg)没有问题,但在 Linux 中我没能做到,因为它需要“算法”标头。
我一直在搜索该标头,它似乎在其他系统中可用,不仅在 Windows 中,而且我的编译器没有找到它。也许这可能是一个非常简单的问题,但我对 Linux 太陌生了。
请注意,该项目是使用 CMake 生成的,我正在尝试使用简单的 make 命令对其进行编译。
提前谢谢你。
frank@TESTWORKSTATION:~/Escritorio/GitLayama/MozJpeg/buildlinux$ make
[ 0%] Built target simd
[ 17%] Built target jpeg-static
[ 19%] Built target jpegtran-static
[ 20%] Building C object CMakeFiles/turbojpeg-static.dir/rdbmp.c.o
In file included from /home/frank/Escritorio/GitLayama/MozJpeg/rdbmp.c:29:
/home/frank/Escritorio/GitLayama/MozJpeg/cmyk.h:21:10: fatal error: algorithm: No such file or directory
21 | #include <algorithm>
| ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/turbojpeg-static.dir/build.make:752:
CMakeFiles/turbojpeg-static.dir/rdbmp.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:209: CMakeFiles/turbojpeg-
static.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
frank@TESTWORKSTATION:~/Escritorio/GitLayama/MozJpeg/buildlinux$
【问题讨论】:
-
你用的是什么编译器?
-
mozjpeg 似乎是一个 C 库。它不会使用
<algorithm>。那部分似乎是一个红鲱鱼 -
我必须查看文件的提交日志以查看是否有人
编辑了,但currently cmyk.h doesn't #include <algorithm>。也许重新拉?刚看了历史。多年未动。 -
查看 cmyk.h 并确保包含确实存在。总有可能有人在玩愚蠢的预处理器游戏。
-
@user4581301 总有可能有人在您不知情的情况下用您的计算机玩完全不傻的游戏。特别是如果你运行像
sudo make这样的命令。
标签: linux algorithm g++ linux-mint