C++ mingw-w64:';中的编译器错误;未定义对`u getreent.';
我目前正在(噩梦般地)尝试在Windows中编译cImg和libjpeg。几个小时后,我终于能够构建libjpeg,并且我已经将其包含在构建过程中(cImg需要libjpeg来处理jpeg) 当我尝试使用“g++image.cpp libjpeg.a-lgdi32”进行编译时,出现以下错误: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.' 我看过谷歌,但
'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'