Linking VS2010 with ImageMagick

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
mantracker
Posts: 1
Joined: 2014-02-16T20:39:51-07:00
Authentication code: 6789

Linking VS2010 with ImageMagick

Post by mantracker »

I've been trying to compile ImageMagick on visual studio 2010, using the tutorial from http://www.fortunomedia.com/magick-plus ... ig-vs2010/

Basicly I've followed the exact same steps described, I've added

C:\Program Files\ImageMagick-6.8.8-Q16\include to VC++ include directories,

C:\Program Files\ImageMagick-6.8.8-Q16\lib to VC++ Library Directories,

C:\Program Files\ImageMagick-6.8.8-Q16\include to Addtional Include Dependencies,


and lastly CORE_RL_magick_.lib; CORE_RL_Magick++_.lib; CORE_RL_wand_.lib; X11.lib to Linker Input Additional Dependencies.

Then I added the folowing lines of Code:

Code: Select all

#include <GLTools.h>
#include <Magick++.h>

class Texture
{
public:
    Texture(GLenum TextureTarget, const std::string& FileName);

    bool Load();

    void Bind(GLenum TextureUnit);

private:
    std::string m_fileName;
    GLenum m_textureTarget;
    GLuint m_textureObj;
    Magick::Image* m_pImage;
    Magick::Blob m_blob;
};
This returns the following error:

Code: Select all

Error 12 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Magick::Blob::~Blob(void)" (__imp_??1Blob@Magick@@UAE@XZ) referenced in function "public: __thiscall Texture::~Texture(void)" (??1Texture@@QAE@XZ) C:\Users\Martin Liu\documents\visual studio 2010\Projects\MyGame\MyGame\mesh.obj MyGame
Now from previous times I dealt with this error, I thought the problem is with the x86 x64 problem, where I linked x64 versions when I should have linked x86 versions. So I went to http://www.imagemagick.org/script/binary-releases.php#windows
downloaded in total 3 versions of imageMagick:

ImageMagick-6.8.8-6-Q16-x64-dll.exe,

ImageMagick-6.8.8-6-Q8-x64-dll.exe,

ImageMagick-6.8.8-6-Q8-x86-dll.exe


Tried all 3 of them, and all of them returned the same error

Any help would be appreciated
jstph
Posts: 31
Joined: 2011-01-27T10:07:43-07:00
Authentication code: 8675308

Re: Linking VS2010 with ImageMagick

Post by jstph »

it looks like this is the reference problem. You probably called "delete blob" in your ~Texture(), if I remember correctly, ImageMigick doesn't export destructor of Blob object. You may need to call DestroyBlob(Blob*) to release the object.
Post Reply