[prev in list] [next in list] [prev in thread] [next in thread] 

List:       imagemagick-user
Subject:    [magick-users] Unresolved External
From:       Doug Brown <toquehead () gmail ! com>
Date:       2008-08-31 3:04:07
Message-ID: 48BA0A27.9070006 () gmail ! com
[Download RAW message or body]

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 *)" 
(__imp_?_Next@?$list@VCoordinate@Magick@@V?$allocator@VCoordinate@Magick@@@std@@@std@@ \
KAAAPAU_Node@?$_List_nod@VCoordinate@Magick@@V?$allocator@VCoordinate@Magick@@@std@@@2@PAU342@@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)" 
(??Econst_iterator@?$list@VCoordinate@Magick@@V?$allocator@VCoordinate@Magick@@@std@@@std@@QAEAAV012@XZ)



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
Magick-users@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic