的Visual Studio 2013和libpng

编程入门 行业动态 更新时间:2024-10-23 18:32:38
本文介绍了的Visual Studio 2013和libpng的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想写使用VS2013使用C中的libpng一个简单的PNG文件。从我安装的NuGet的libpng,其中包括png.h,但我不能编译。我得到这个作为我的输出:

I'm trying to write a simple PNG file using libpng in C using VS2013. I installed libpng from Nuget and included png.h, but I can't compile. I get this as my output:

1>main.obj : error LNK2019: unresolved external symbol png_create_write_struct referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_set_longjmp_fn referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_create_info_struct referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_write_info referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_destroy_write_struct referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_init_io referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_free_data referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_set_IHDR referenced in function writeImage 1>main.obj : error LNK2019: unresolved external symbol png_set_text referenced in function writeImage

我试着编译设置打,但似乎没有任何使其工作。我不明白在任何时候那些我写的code声明的任何红线,所以VS必须看到一些code的。

I've tried playing with the compilation settings, but nothing seems to make it work. I don't get any red lines under any of those declarations when I write the code, so VS must be seeing some of the code.

推荐答案

此外,包括 png.h 您还必须用适当的导入库(可能称为链接 libpng.lib 或类似的东西)。在Visual Studio中,可以添加这的项目设置→连接器→输入→附加依赖的

Besides including png.h you must also link with the appropriate import library (probably called libpng.lib or something similar). In Visual Studio, you would add this to Project Settings → Linker → Input → Additional Dependencies.

更多推荐

的Visual Studio 2013和libpng

本文发布于:2023-11-07 06:31:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565776.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Studio   Visual   libpng

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!