ImageMagick静态编译与另一个项目给出链接器错误 [英] ImageMagick static compilation with another project gives linker errors
问题描述
我已经下载了ImageMagick源代码,编译了向导来为静态链接创建一个Visual Studio解决方案,并在我的示例项目(下面的代码)中包含了静态库Magick ++项目。我还在该项目中添加了一个依赖项,并将.lib文件包含在解决方案中,没有任何帮助。
#include< ; Magick ++。
int main()
{
Magick :: Image image;
bool test = image.isValid();
return 0;
}
这会产生几个链接器错误,例如:
未解析的外部符号__declspec(dllimport)public:virtual _ thiscall Magick :: Image ::〜Image(void)( _imp _ ?? 1Image @ Magick @@ UAE为什么找不到实现?
我在使用Visual Studio 2010 Beta 2。
问题可能会从使用不同的编译器比库编译。因为你的编译器是新的,它很可能使用不同的名称调整,并且不能在库中找到方法签名。
I've downloaded the ImageMagick source, compiled the wizard to create a Visual Studio solution for static linkage, and included the static library Magick++ project in my sample project (code below). I've also added a dependency on that project and included the .lib file in the solution, nothing helps.
#include <Magick++.h>
int main()
{
Magick::Image image;
bool test = image.isValid();
return 0;
}
This gives several linker errors, such as:
unresolved external symbol "__declspec(dllimport) public: virtual _thiscall Magick::Image::~Image(void)" (_imp_??1Image@Magick@@UAE@XZ) referenced in function _main
Why can't it find the implementation?
I'm using Visual Studio 2010 Beta 2.
The problem may rise from that you are using different compiler than the library was compiled with. As your compiler is fairly new, it's very likely it uses different name mangling and can't find method signatures inside the library.
这篇关于ImageMagick静态编译与另一个项目给出链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!