将 SDL_Image 与 libpng 链接时出现问题

发布于 2024-09-01 08:10:00 字数 399 浏览 1 评论 0原文

我正在尝试在 Windows 上使用 MinGW + MSys (gcc 4.5.0) 编译 SDL_Image 1.2.10,我已经编译了所有需要的库(zlib 1.2.5、libpng 1.4.2、libjpeg 8a、libtiff 3.9.2)。 SDL_Image 编译正常,但无法链接到 libpng,在各种 png 结构上抛出 .libs/IMG_png.o:IMG_png.c:(.text+0x16): undefined reference 错误。

如果我为 SDL_Image 运行 ./configure --prefix=/mingw --disable-png ,它会编译并链接到其他库。我尝试过旧版本的 libpng (1.2.43),但它们也导致 SDL_Image 抛出相同的错误。

I'm trying to compile SDL_Image 1.2.10 with MinGW + MSys (gcc 4.5.0) on Windows, I have compiled all the requires libs (zlib 1.2.5, libpng 1.4.2, libjpeg 8a, libtiff 3.9.2). SDL_Image compiles fine, but fails to link to libpng, throwing .libs/IMG_png.o:IMG_png.c:(.text+0x16): undefined reference errors on various png structs.

If I run ./configure --prefix=/mingw --disable-png for SDL_Image, it compiles and links against the other libs just fine. I have tried older versions of libpng (1.2.43), but they also caused SDL_Image to throw the same errors.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

驱逐舰岛风号 2024-09-08 08:10:00

将我的 GCC 套件降级到 4.4.0 解决了这个问题,看来 4.5.0 仍然存在一些初期问题。
除非有人对为什么我无法与 GCC 4.5.0 正确链接提出更好的答案,否则我会将自己的答案标记为正确。

Downgrading my GCC suite to 4.4.0 fixed the problem, it seems 4.5.0 still has a few teething issues.
Unless someone comes up with a better answer as to why I can't link properly with GCC 4.5.0 I shall mark my own answer as correct.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文