如何静态链接FreeImage 库?
这是为使用 FreeImage Library(一个开源 C 库来管理图像)的人提供的: http://freeimage.sourceforge.net/
这个问题已经在不同的论坛上提交了很多次,但我无法找不到答案。 如果有人知道解决方案,请提交。
我想将此库用作静态库,而不是使用附加的 *.dll 文件。 不幸的是,我收到“无法解析的外部符号”。
在 FreeImage FAQ 中有一个主题: 如何使用 FreeImage 作为静态库而不是 DLL (Visual C++ 6) ? http://freeimage.sourceforge.net/faq.html
不幸的是它不起作用,因为我收到“无法解析的外部符号”消息 即使只有一个“FreeImage_Initialise()”函数 我正在使用 MS VC++ 2008 和 2010 Express。
所以我寻求帮助。我注意到很多人都有同样的问题。
也许只是 MS Visual 项目中正确选项的问题?
This is for people using FreeImage Library - an open source C library to manage images:
http://freeimage.sourceforge.net/
This question has been submitting many times in different forums, but I couldn't find the answer.
If somebody knows the soulution please submit.
I want to use this Library as STATIC library instead of using additional *.dll file.
Unfortunately I Iam getting "unresolved external symbol".
In FreeImage FAQ there is a topic:
How to use FreeImage as a static library instead of as a DLL (Visual C++ 6) ?
http://freeimage.sourceforge.net/faq.html
Unfortunately it doesn't work, because I am recieving "unresolved external symbol" message
even if there is only one "FreeImage_Initialise()" function
I am working in MS VC++ 2008 and 2010 Express.
So I am asking for help. I noted that many people had this same problem.
Maybe is just a question of proper options in MS Visual project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我自己找到了答案。
因为VC++ 2008下的FreeImage解决方案无法在VC++ 2010下打开我创建了静态.lib文件
在VC++ 2008版本中。将其与 VC++ 2010 中的项目链接时出现错误:无法解析的外部符号,
但后来我尝试将其链接到 VC++ 2008 中的项目下,并且链接成功。
看来 VC++ 2008 的静态库在 2010 年表现不佳,可能是 VC++ Express 2010 的 bug...
I think I found the answer myself.
Because the FreeImage solution under VC++ 2008 can't open under VC++ 2010 I created static .lib file
in VC++ 2008 version. Linkin it with project in VC++ 2010 gave error: unresolved external symbol,
but then I tried to link it under a project in VC++ 2008 and it linked successfully.
It seems that static libs from VC++ 2008 works bad in 2010, maybe its VC++ Express 2010 bug...
我使用 Visual 2012 Express,效果很好! FreeImage已经是.NET的包装器,所以你必须在.NET项目中使用它,而不是在VC++中。这不是 Bug。
I used Visual 2012 express and it work fine! FreeImage has been wrapper for .NET, so you must use it in .NET project, not in VC++. This is not Bug.