I am trying to use ImageMagick in a C++/Win32/MFC/COM application. I am
using MS Visual Studio 7, with MFC in a DLL. I can build the the
Magick++ samples fine.
I can build my application, linking to Magick++ (6.4.3), also fine,
until I code something like:
list<Coordinate> l2;
for (list<Coordinate>::const_iterator it2 = l2.begin(); it2 != l2.end();
it2++) {}
Then I get an unresolved external, apparently related to the
iterator/allocator of list<Coordinate>:
BiviMap.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) protected: static struct std::_List_nod<class
Magick::Coordinate,class std::allocator<class Magick::Coordinate>
>::_Node * & __cdecl std::list<class Magick::Coordinate,class
std::allocator<class Magick::Coordinate> >::_Next(struct
std::_List_nod<class Magick::Coordinate,class std::allocator<class
Magick::Coordinate> >::_Node *)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL
PROTECTED]@Magick@@@std@@@std@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL
PROTECTED]@Magick@@@std@@@[EMAIL PROTECTED]@@Z)
referenced in function "public: class std::list<class
Magick::Coordinate,class std::allocator<class Magick::Coordinate>
>::const_iterator & __thiscall std::list<class Magick::Coordinate,class
std::allocator<class Magick::Coordinate>
>::const_iterator::operator++(void)"
([EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL
PROTECTED]@Magick@@@std@@@std@@[EMAIL PROTECTED])
I am not familiar with the std library, so I'm not sure what this is
telling me. If I put the same code in the flip demo, it builds fine. If
I put this code
list<Image> imageList;
for (list<Image>::const_iterator it = imageList.begin(); it !=
imageList.end(); it++)
Image i = *it;
in my application, it builds fine, so the Image iterator works when the
Coordinate doesn't. I note in drawable.h there is this code:
#if defined(MagickDLLBuild)
MagickDrawableExtern template class MagickDLLDecl
std::allocator<Magick::Coordinate>;
MagickDrawableExtern template class MagickDLLDecl
std::list<Magick::Coordinate, std::allocator<Magick::Coordinate> >;
#endif // MagickDLLBuild
Which makes me wonder ... I added MagickDLLDecl to my list of build
DEFINES, but that only added a macro redefinition error to my troubles.
I have looked carefully at all the build settings in the demo programs
and compared them to mine. They are not identical, as I am building a
COM/MFC/DLL instead of a console exe, but I have tried everything I can
think of.
Any assistance would be greatly appreciated.
Thanks,
Doug.
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users