Error when compiling in Visual C++ 2010 Express

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
14K
Posts: 7
Joined: 2013-01-16T14:02:03-07:00
Authentication code: 6789

Error when compiling in Visual C++ 2010 Express

Post by 14K »

I have recently installed ImageMagick libraries for C++ and i have no prior experience with C++ GUI but I'm very good in C++ command line programming.

I have installed ImageMagick in windows through an exe file and copied libraries and header files to C++ but whenevr i am trying to run any demo program i am consistently getting this error.

Code: Select all

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 ==========
I desperately wants to know what is causing this error and why even the demo programs are not working ?
Kindly guide me.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Error when compiling in Visual C++ 2010 Express

Post by magick »

You need a starting point, go to c:\Program Files\ImageMagick-6.8.1-Q16\Magick++_demos. Click on the button workspace, build, and run. Assuming that's successful, use the button workspace as a template for your own custom code.
14K
Posts: 7
Joined: 2013-01-16T14:02:03-07:00
Authentication code: 6789

Re: Error when compiling in Visual C++ 2010 Express

Post by 14K »

Thank you for your response sir,

I've tried this too dozens of time and continuously getting this error.
The Project must be Converted to current Visual C++ project format. After it has been converted you will not be able to edit this project in previous version of visual studio.
Convert and open this project ?
When i click yes nothing happens nothing shows on the screen blank visual C++ screen with no project open.

it merits mentioning that i've installed Visual C++ 2010 x86 and downloaded ImageMagick for x86 , no idea what is mean by dynamic and static so i treid both but still no luck.
Its been like 23 hours i am trying to make it work.
Kindly guide me.
Post Reply