Hi, I am new to Eclipse CDT. I am trying to integrate ImageMagick into eclipse. After installing Image magick and maintaining the path in Environment variables, I created a new c++ project with MINGW GCC compiler.
I am trying to test the below simple program-
#include <Magick++.h>
#include <iostream>
#include <string>
using namespace std;
using namespace Magick;
int main(int argc, char**argv){
InitializeMagick(*argv);
Image img;
img.read("Image/happy-fish.jpg");
img.write("Image/fish.png");
return 0;
}
But i get the below error while trying to Build the project-
Info: Internal Builder is used for build
g++ "-LC:\\Development\\ImageMagick-7.0.3-Q8\\lib" -o magickTest.exe "src\\zoom.o" -lCORE_RL_Magick++_ -lCORE_RL_MagickWand_ -lCORE_RL_MagickCore_
src\zoom.o: In function `main':
C:\Development\Workspace\magickTest\Debug/../src/zoom.cpp:18: undefined reference to `Magick::InitializeMagick(char const*)'
C:\Development\Workspace\magickTest\Debug/../src/zoom.cpp:19: undefined reference to `Magick::Image::Image()'
C:\Development\Workspace\magickTest\Debug/../src/zoom.cpp:20: undefined reference to `Magick::Image::read(std::string const&)'
C:\Development\Workspace\magickTest\Debug/../src/zoom.cpp:21: undefined reference to `Magick::Image::write(std::string const&)'
C:\Development\Workspace\magickTest\Debug/../src/zoom.cpp:23: undefined reference to `Magick::Image::~Image()'
C:\Development\Workspace\magickTest\Debug/../src/zoom.cpp:23: undefined reference to `Magick::Image::~Image()'
collect2.exe: error: ld returned 1 exit status
I have added the header file path to GCC c++ Compiler --> Include path (-I)
"C:\Development\ImageMagick-7.0.3-Q8\include"
and the library files to MinGW C++ Linker --> Libraries(-I):
CORE_RL_Magick++_
CORE_RL_MagickWand_
CORE_RL_MagickCore_
and the path to Library Search Path(-L)
C:\Development\ImageMagick-7.0.3-Q8\lib
My system details are as below:
Windows 7 OS, SP1
Eclipse Neon CDT
ImageMagick-7.0.3-Q8
Can someone please help me with this. Please let me know how do I solve this error.