Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/160.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ mingw-w64:';中的编译器错误;未定义对`u getreent.';_C++_Mingw W64_Libjpeg - Fatal编程技术网

C++ mingw-w64:';中的编译器错误;未定义对`u getreent.';

C++ mingw-w64:';中的编译器错误;未定义对`u getreent.';,c++,mingw-w64,libjpeg,C++,Mingw W64,Libjpeg,我目前正在(噩梦般地)尝试在Windows中编译cImg和libjpeg。几个小时后,我终于能够构建libjpeg,并且我已经将其包含在构建过程中(cImg需要libjpeg来处理jpeg) 当我尝试使用“g++image.cpp libjpeg.a-lgdi32”进行编译时,出现以下错误: 'jerror.c:112: undefined reference to `__getreent. The system cannot find the path specified.' 我看过谷歌,但

我目前正在(噩梦般地)尝试在Windows中编译cImg和libjpeg。几个小时后,我终于能够构建libjpeg,并且我已经将其包含在构建过程中(cImg需要libjpeg来处理jpeg)

当我尝试使用“g++image.cpp libjpeg.a-lgdi32”进行编译时,出现以下错误:

'jerror.c:112: undefined reference to `__getreent. The system cannot find the path specified.'
我看过谷歌,但似乎没有多少人有同样的问题(有答案的人更少)


我正在windows中使用mingw-w64进行编译。

我已经解决了这个问题。对于有相同问题的任何人:

  • 确保使用相同的编译器编译libjpeg.a和cImg(即gcc或mingw-w64)

  • 由于使用mingw-w64编译libjpeg有困难,我使用了gcc编译器,但是如果您使用这个库,您也需要使用gcc编译cImg(这会导致其他问题…)

  • 通过更改路径,我最终成功地在MSYS2中使用mingw-w64编译了libjpeg。为此,您需要继承Windows路径-编辑'msys2_shell.cmd'并从
    'set msys2_Path_TYPE=inherit'中删除
    'rem'