[英]Installing Magick++ in Visual C++ 2010
我最近安裝了C ++的ImageMagick庫。 我沒有使用C ++ GUI的經驗,但是我在C ++命令行編程方面非常出色。
我已經通過.exe文件在Windows中安裝了ImageMagick,並將庫和頭文件復制到了C ++,但是每當我嘗試運行任何演示程序時,我總是會收到此錯誤:
1>------ Build started: Project: Sufiyan, Configuration: Debug Win32 ------
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Magick::Image::~Image(void)" (__imp_??1Image@Magick@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Magick::Image::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?write@Image@Magick@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Magick::Image::pixelColor(long,long,class Magick::Color const &)" (__imp_?pixelColor@Image@Magick@@QAEXJJABVColor@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Magick::Color::~Color(void)" (__imp_??1Color@Magick@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Magick::Geometry::~Geometry(void)" (__imp_??1Geometry@Magick@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Magick::Image::Image(class Magick::Geometry const &,class Magick::Color const &)" (__imp_??0Image@Magick@@QAE@ABVGeometry@1@ABVColor@1@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Magick::Geometry::Geometry(char const *)" (__imp_??0Geometry@Magick@@QAE@PBD@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Magick::Color::Color(char const *)" (__imp_??0Color@Magick@@QAE@PBD@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl Magick::InitializeMagick(char const *)" (__imp_?InitializeMagick@Magick@@YAXPBD@Z) referenced in function _main
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\Z-Axis\documents\visual studio 2010\Projects\Sufiyan\Debug\Sufiyan.exe : fatal error LNK1120: 10 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
這些是我的筆記本電腦規格:
這是我嘗試安裝的方式:
但是當我運行任何代碼時,都會出現上述錯誤。
有人建議此解決方案:
您需要一個起點,轉到
c:\\ Program Files \\ ImageMagick-6.8.1-Q16 \\ Magick ++ _ demos。
單擊按鈕工作區,構建並運行。
假設成功,則將按鈕工作區用作您自己的自定義代碼的模板。
我也嘗試了數十次,並且不斷收到此錯誤:
該項目必須轉換為當前的Visual C ++項目格式。
轉換后,您將無法在Visual Studio的早期版本中編輯此項目。 轉換並打開該項目?
當我單擊“ Yes
時,沒有任何反應,屏幕上什么也沒有顯示-沒有打開任何項目的Visual C ++空白屏幕。
我非常想知道:是什么原因導致此錯誤,為什么甚至演示程序也無法正常工作?
嘗試自己構建ImageMagick,問題可能出在不同版本的編譯器上。
請按照ImageMagick的高級Windows安裝中的說明進行操作 。 在上一頁的最后,有一個解決鏈接錯誤的方法,請確保已設置預處理器。 我只是跟隨它成功構建了一個項目。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.