I feel I'm starting yet another dead-end thread as I have yet to find a solution on these forums or elsewhere. Everyone posts the errors, no one has an answer. But, since you pointed me to that page, let's see if that's all you can help with:
-----
I am running Code::Blocks version 13.12 on Windows
(Windows 7 Ultimate 64-bit). The compiler I use is MinGW
version 4.7.1 32-bit. <-- the one that comes with C::B.
When I ...Simply can't finish a compile of anything that requires to be linked against the ImageMagick library. Other code that does not use IM compiles fine, no problems. That tells me the compiler itself is working fine. It's merely the final linking step, against IM, that doesn't appear to work, or rather, I can't figure out how it should be configured to work.
Description of problem.C::B compiles the .o object file but then fails to link it to create the final executable.
Build log:mingw32-g++.exe -O2 -I"C:\Program Files\ImageMagick-6.8.8-Q16\include" -c T:\povpoi\arc.cpp -o T:\povpoi\arc.o
mingw32-g++.exe -L"C:\Program Files\ImageMagick-6.8.8-Q16\lib" -o T:\povpoi\arc.exe T:\povpoi\arc.o "C:\Program Files\ImageMagick-6.8.8-Q16\lib\CORE_RL_magick_.lib" "C:\Program Files\ImageMagick-6.8.8-Q16\lib\CORE_RL_Magick++_.lib" "C:\Program Files\ImageMagick-6.8.8-Q16\lib\CORE_RL_wand_.lib"
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x84): undefined reference to `Magick::InitializeMagick(char const*)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x249): undefined reference to `Magick::Image::Image(std::string const&)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x26a): undefined reference to `Magick::Image::constImage() const'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x2c8): undefined reference to `Magick::Image::unsharpmask(double, double, double, double)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x2ed): undefined reference to `Magick::Color::Color(unsigned short, unsigned short, unsigned short)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x305): undefined reference to `Magick::Image::constImage() const'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x344): undefined reference to `Magick::Geometry::Geometry(unsigned int, unsigned int, int, int, bool, bool)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x36f): undefined reference to `Magick::Image::extent(Magick::Geometry const&, Magick::Color const&)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x387): undefined reference to `Magick::Geometry::~Geometry()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x392): undefined reference to `Magick::Image::constImage() const'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x3d2): undefined reference to `Magick::Geometry::Geometry(unsigned int, unsigned int, int, int, bool, bool)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x3f3): undefined reference to `Magick::Image::size(Magick::Geometry const&)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x409): undefined reference to `Magick::Geometry::~Geometry()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x41b): undefined reference to `Magick::Image::virtualPixelMethod(MagickCore::VirtualPixelMethod)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x45c): undefined reference to `Magick::Image::distort(MagickCore::DistortImageMethod, unsigned int, double const*, bool)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x471): undefined reference to `Magick::Image::virtualPixelMethod(MagickCore::VirtualPixelMethod)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x4b0): undefined reference to `Magick::Image::distort(MagickCore::DistortImageMethod, unsigned int, double const*, bool)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x4be): undefined reference to `Magick::Image::constImage() const'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x4d5): undefined reference to `Magick::Image::constImage() const'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x513): undefined reference to `Magick::Geometry::Geometry(unsigned int, unsigned int, int, int, bool, bool)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x546): undefined reference to `Magick::Image::extent(Magick::Geometry const&, Magick::Color const&, MagickCore::GravityType)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x55e): undefined reference to `Magick::Geometry::~Geometry()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x572): undefined reference to `Magick::Image::write(std::string const&)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x588): undefined reference to `Magick::Color::~Color()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x59d): undefined reference to `Magick::Image::~Image()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x601): undefined reference to `Magick::Geometry::Geometry(char const*)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x620): undefined reference to `Magick::Image::resize(Magick::Geometry const&)'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x636): undefined reference to `Magick::Geometry::~Geometry()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x8bf): undefined reference to `Magick::Geometry::~Geometry()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x8d4): undefined reference to `Magick::Color::~Color()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x8e9): undefined reference to `Magick::Image::~Image()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x903): undefined reference to `Magick::Geometry::~Geometry()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x91a): undefined reference to `Magick::Geometry::~Geometry()'
T:\povpoi\arc.o:arc.cpp:(.text.startup+0x931): undefined reference to `Magick::Geometry::~Geometry()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 1 second(s))
34 error(s), 0 warning(s) (0 minute(s), 1 second(s))
Crash report:Code::Blocks did not crash.
(Although the following is not necessary, showing that you
have tried increases the probability of a response.)
I have already tried ...Every error report I've read/seen online pointed to needing to add the libraries and search paths in C::B, which I have done. When I don't do that, the compiler immediately stops because it can't find 'Magick++.h', so that tells me that at least *some* of the configuration is working, but there's still something missing. So here it is, one at a time:
- Settings->Compiler...
- Under 'Linker Settings' I added the libraries:
C:\Program Files\ImageMagick-6.8.8-Q16\lib\CORE_RL_magick_.lib
C:\Program Files\ImageMagick-6.8.8-Q16\lib\CORE_RL_Magick++_.lib
C:\Program Files\ImageMagick-6.8.8-Q16\lib\CORE_RL_wand_.lib
- 'Other linker options' is empty.
- Under 'Search directories -> Compiler', I added:
C:\Program Files\ImageMagick-6.8.8-Q16\include
- Under 'Search directories -> Linker', I added:
C:\Program Files\ImageMagick-6.8.8-Q16\lib
That's all of it.
As for compiling the code from the command line, it won't work in a Win32 shell because IM does not provide a 'Magick++-config' for Win32 platforms. However, in a cygwin environment it compiles fine. On a unix platform, it compiles fine. The command line used in those environments is:
c++ -O2 <file>.cpp -o <compiled-binary> `Magick++-config --cppflags --cxxflags --ldflags --libs`