Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » ImageMagick++ in Eclipse CDT(Configuring magick++ on Eclipse Neon CDT to build without errors)
ImageMagick++ in Eclipse CDT [message #1747526] Tue, 15 November 2016 16:21 Go to next message
Joyita Das is currently offline Joyita DasFriend
Messages: 4
Registered: November 2016
Junior Member
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.
Re: ImageMagick++ in Eclipse CDT [message #1747563 is a reply to message #1747526] Wed, 16 November 2016 01:11 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You seem to have set the libraries correctly.
If those are the actual libraries (I have never used ImageMagick) they could be in the wrong order.
The order of the libraries is important to the linker.
The library containing the code must follow all references to that code.
Try shuffling the order or use a utility (like "nm") to list the library names.

OR, you may have a missing library.
FWIW: in Linux, pkg-config lists only -lMagickCore-6.Q16 as the needed library option.
That may not apply in other configurations.

Generally, this is OT as it is not an Eclipse/CDT issue.
Previous Topic:Setting GCC linker library options
Next Topic:Eclipse installer questions
Goto Forum:
  


Current Time: Tue May 14 20:33:00 GMT 2024

Powered by FUDForum. Page generated in 0.03243 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top