I recently got success to install Magick++ and use it in my MFC program(after large amount of try on Visual C++ 2010). My goal is to decode a animated gif to many bitmaps. I need all the bitmap frames. I have use the code below but I received many errors. I do appreciate if someone can help me . I also be thankful if someone suggest me a good documentation about Magick++ with examples because I am totally new to this library here is my code :
Code: Select all
#include "stdafx.h"
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
int main(int argc,char **argv)
{
InitializeMagick(*argv);
std::list<Magick::Image> imageList;
/* read all the frames of the animated GIF */
Magick::readImages( &imageList, "animated.gif" );
getchar();
return 0;
}
1>------ Rebuild All started: Project: test_Magiclibarary, Configuration: Debug Win32 ------
1>Build started 7/6/2013 12:52:35 AM.
1>InitializeBuildStatus:
1> Touching "Debug\test_Magiclibarary.unsuccessfulbuild".
1>ClCompile:
1> stdafx.cpp
1> test_MagiclibararyDlg.cpp
1>d:\shervin_zargham\industrial projects\led display\imagemagick-windows\imagemagick-6.8.5\magick++\lib\magick++\stl.h(2487): warning C4996: 'std::basic_string<_Elem,_Traits,_Ax>::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring(1555) : see declaration of 'std::basic_string<_Elem,_Traits,_Ax>::copy'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _Ax=std::allocator<char>
1> ]
1> d:\shervin_zargham\industrial projects\led display\programming\mfc 2010\test_magiclibarary\test_magiclibarary\test_magiclibararydlg.cpp(212) : see reference to function template instantiation 'void Magick::readImages<std::list<_Ty>>(Container *,const std::string &)' being compiled
1> with
1> [
1> _Ty=Magick::Image,
1> Container=std::list<Magick::Image>
1> ]
1> test_Magiclibarary.cpp
1> Generating Code...
1>test_MagiclibararyDlg.obj : error LNK2019: unresolved external symbol __imp__DestroyExceptionInfo referenced in function "void __cdecl Magick::readImages<class std::list<class Magick::Image,class std::allocator<class Magick::Image> > >(class std::list<class Magick::Image,class std::allocator<class Magick::Image> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$readImages@V?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@@Magick@@YAXPAV?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z)
1>test_MagiclibararyDlg.obj : error LNK2019: unresolved external symbol __imp__DestroyImageInfo referenced in function "void __cdecl Magick::readImages<class std::list<class Magick::Image,class std::allocator<class Magick::Image> > >(class std::list<class Magick::Image,class std::allocator<class Magick::Image> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>> const &)" (??$readImages@V?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@@Magick@@YAXPAV?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z)
1>test_MagiclibararyDlg.obj : error LNK2019: unresolved external symbol __imp__ReadImage referenced in function "void __cdecl Magick::readImages<class std::list<class Magick::Image,class std::allocator<class Magick::Image> > >(class std::list<class Magick::Image,class std::allocator<class Magick::Image> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$readImages@V?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@@Magick@@YAXPAV?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z)
1>test_MagiclibararyDlg.obj : error LNK2019: unresolved external symbol __imp__GetExceptionInfo referenced in function "void __cdecl Magick::readImages<class std::list<class Magick::Image,class std::allocator<class Magick::Image> > >(class std::list<class Magick::Image,class std::allocator<class Magick::Image> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>> const &)" (??$readImages@V?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@@Magick@@YAXPAV?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z)
1>test_MagiclibararyDlg.obj : error LNK2019: unresolved external symbol __imp__CloneImageInfo referenced in function "void __cdecl Magick::readImages<class std::list<class Magick::Image,class std::allocator<class Magick::Image> > >(class std::list<class Magick::Image,class std::allocator<class Magick::Image> > *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >const &)" (??$readImages@V?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@@Magick@@YAXPAV?$list@VImage@Magick@@V?$allocator@VImage@Magick@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z)
1>D:\Shervin_Zargham\Industrial Projects\LED Display\Programming\MFC 2010\test_Magiclibarary\Debug\test_Magiclibarary.exe : fatal error LNK1120: 5 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:10.26
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========