【问题标题】:Compiler error in mingw-w64: 'undefined reference to `__getreent.'mingw-w64 中的编译器错误:“未定义对 __getreent 的引用。”
【发布时间】:2018-01-04 19:18:46
【问题描述】:

我目前正处于尝试在 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.'

我在 google 上查看过,但似乎没有多少人遇到同样的问题(回答问题的人更少)。

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

【问题讨论】:

    标签: c++ mingw-w64 libjpeg


    【解决方案1】:

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

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

    • 由于使用 mingw-w64 编译 libjpeg 时遇到困难,我使用了 gcc 编译器,但如果您使用此库,则还需要使用 gcc 编译 cImg(这会导致其他问题...)

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-07-29
      • 2011-02-06
      • 2016-06-23
      • 1970-01-01
      • 2020-03-27
      相关资源
      最近更新 更多