首页 > 解决方案 > #包括linux C++中的致命错误

问题描述

我在 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$

标签: linuxalgorithmg++linux-mint

解决方案


正如一些用户所说,标题不正确,我不知道错误回购的日期是什么,但是从上一个 Git 版本重新下载它可以正常工作。


推荐阅读