Click here to Skip to main content
11,802,762 members (68,767 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ MFC
Hello, guys.
I got stuck with connecting Magick++ library (It's a bunch of libraries to handle images) in my C++ project.
Maybe someone have some experience how to do this.
I'm using VS 2012 and already built a VisualStaticMT solution from binaries.
But there is no way I could employ compiled libs in my project.
It seems to me the problem consist in Linker. I tried to find step-by-step solution but in vain.

Error 46 error LNK1104: cannot open file 'CORE_DB_magick_.lib'
I tried to copy it in the project dir( it gave nothing)

It would be great to see an accurate clarification how to use this Lib in C++ using VS not only for me, but for others who have the same troubles.
Posted 17-Sep-12 14:46pm
Edited 18-Sep-12 8:51am
Sergey Alexandrovich Kryukov at 17-Sep-12 21:04pm
This "I got stuck is not informative". You did not provide enough information to help you.
Wes Aday at 17-Sep-12 22:34pm
" I could employ compiled libs in my project", and why could you not link to the libraries?
Wes Aday at 18-Sep-12 13:34pm
Did you add the path to those libraries in the project settings in VS?
JOHN 602 at 18-Sep-12 14:42pm
Of course I did
Project->"MyProject" Properties->Configuration Properties->
than in VC++ Directories :
in field "Include directories" I set
"C:\Users\Administrator\Desktop\New folder\ImageMagick-6.6.9;C:\Users\Administrator\Desktop\New folder\ImageMagick-6.6.9\VisualMagick\lib;C:\Users\Administrator\Desktop\New folder\ImageMagick-6.6.9\Magick++\lib;$(IncludePath)"
in field "Library directorie" i set:
C:\Users\Administrator\Desktop\New folder\ImageMagick-6.6.9\Magick++\lib;$(LibraryPath)
Than in Linker(tab)->General in field "Additional Library Directories" I set
%USERPROFILE%\C:\Users\Administrator\Desktop\New folder\ImageMagick-6.6.9\VisualMagick\lib;%USERPROFILE%\C:\Users\Administrator\Desktop\New folder\ImageMagick\libxml\win32\dsp\libxml2;%(AdditionalLibraryDirectories)
In Linker->Input in field "Addition Dependencies" i set
Than in filed "Add module to assembly" I set
Richard MacCutchan at 18-Sep-12 16:03pm
%USERPROFILE%\C:\Users\Administrator\Desktop\New folder\ImageMagick-6.6.9\VisualMagick\lib

That %USERPROFILE%\ at the front does not look right. What does that complete expression evaluate to?
JackDingler at 18-Sep-12 17:07pm
Looks like it's missing a semicolon between the paths.
Richard MacCutchan at 18-Sep-12 17:11pm
Looks like a lack of understanding.
JOHN 602 at 18-Sep-12 17:30pm
Yeah man. You know smth has changed. I excluded %USERPROFILE%\ from "Additional Library Directories".Started program and got "Missing CORE_RL_bzlib_lib". I exclude all CORE_RL_-libs from "Addition Dependencies" because they initially are absent in Magick++ due to I built it from binaries and checked "For multithreading static libs" instead of just for single thread(Don't remember how checkbox was called).
Instead of CORE_RL_bzlib_lib in assembled Magik++ exist CORE_bzlib_xt_lib and this ain't important.(Of course I need to add coorect name of.lib with "_xt_").
But now I got errors like:
error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl Magick::InitializeMagick(char const *)" (__imp_?InitializeMagick@Magick@@YAXPBD@Z) referenced in function _main
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Magick::Image::Image(class std::basic_string,class std::allocator > const &)" (__imp_??0Image@Magick@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main

Before writing this, I've checked smth info this errors type... Nothing useful
JOHN 602 at 18-Sep-12 17:46pm
Just set libs extensions properly
Now in In Linker->Input in field "Addition Dependencies" :
ws2_32.lib;CORE_DB_magick_.lib;CORE_DB_Magick++_.lib;CORE_DB_bzlib_xt_.lib;CORE_DB_coders_.lib;CORE_DB_filters_xt_.lib;CORE_DB_jbig_xt_.lib;CORE_DB_jp2_xt_.lib;CORE_DB_jpeg_xt_.lib;CORE_DB_lcms_xt_.lib;CORE_DB_libxml_xt_.lib;CORE_DB_png_xt_.lib;CORE_DB_tiff_xt_.lib;CORE_DB_ttf_xt_.lib;CORE_DB_wand_xt_.lib;CORE_DB_wmf_xt_.lib;CORE_DB_xlib_xt_.lib;CORE_DB_zlib_xt_.lib ;%(AdditionalDependencies)

After compiling I got LNK1104: cannot open file 'CORE_DB_bzlib_xt_.lib' WTF ??
Richard MacCutchan at 19-Sep-12 4:37am
You seem to be going round in circles randomly changing things rather than looking closely at what you need to add into your project.

The Additional Library Directories field should contain the full paths of the directories containing the libraries that you wish to use.

The Additional Dependencies field should contain the names of all the libraries that contain the definitions of any references that you are using, and these need to be included once only.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 CPallini 270
4 Sergey Alexandrovich Kryukov 239
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 18 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100