Having trouble finding -lmagick++
Posted: 2017-06-12T17:37:59-07:00
Hello!
I'm currently trying to get a simple c++ code to compile with the Magick++ API. The actual code I'm comipling is dirt simple. Just a "hello world" with #include Magick++.h at the top.
The problem is that the compiler cant seem to find -lMagick++. See the error below
ImageMagick was installed from binaries in cygwin over windows 7. I did the following configuration after install
When I type
The following is returned
The CPP file is as follows:
This was compiled using:
And the compiler spits back:
What am I doing wrong?? I've been trying to figure this out for hours... :/
THANK YOU!!
I'm currently trying to get a simple c++ code to compile with the Magick++ API. The actual code I'm comipling is dirt simple. Just a "hello world" with #include Magick++.h at the top.
The problem is that the compiler cant seem to find -lMagick++. See the error below
ImageMagick was installed from binaries in cygwin over windows 7. I did the following configuration after install
Code: Select all
export MAGICK_HOME="$HOME/ImageMagick-6.8.8"
export PATH="$MAGICK_HOME/bin:$PATH"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$MAGICK_HOME/lib"
export PKG_CONFIG_PATH="$MAGICK_HOME/lib/pkgconfig"
Code: Select all
identify -list configure
Code: Select all
Path: /usr/lib/ImageMagick-6.7.6/config/configure.xml
Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -fopenmp -g -O2 -pipe -Wall
CODER_PATH /usr/lib/ImageMagick-6.7.6/modules-Q16/coders
CONFIGURE /pub/devel/imagemagick/ImageMagick-6.7.6.3-1/src/ImageMagick-6.7.6 -3/configure '--srcdir=/pub/devel/imagemagick/ImageMagick-6.7.6.3-1/src/ImageMa gick-6.7.6-3' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindi r=/usr/sbin' '--libexecdir=/usr/lib' '--datadir=/usr/share' '--localstatedir=/va r' '--sysconfdir=/etc' '--datarootdir=/usr/share' '--docdir=/usr/share/doc/Image Magick' '-C' '--disable-static' '--without-modules' '--with-quantum-depth=16' '- -with-autotrace' '--with-bzlib' '--with-dps' '--with-fftw' '--with-fontconfig' ' --with-fpx' '--with-freetype' '--with-gslib' '--with-gvc' '--with-jbig' '--with- jpeg' '--with-jp2' '--without-lcms' '--with-lcms2' '--with-lzma' '--with-pango' '--with-png' '--with-rsvg' '--with-tiff' '--without-wmf' '--with-x' '--with-xml' '--with-zlib' '--without-included-ltdl' '--with-ltdl-include=/usr/include' '--w ith-ltdl-lib=/usr/lib' '--with-fontpath=/usr/share/fonts' '--with-gs-font-dir=/u sr/share/ghostscript/fonts' '--with-windows-font-dir=/usr/share/fonts/TTF' '--wi th-perl' '--with-perl-options=INSTALLDIRS=vendor' 'CC=gcc' 'CFLAGS=-g -O2 -pipe ' 'LDFLAGS=' 'LIBS=' 'CPPFLAGS=' 'CXX=g++' 'CXXFLAGS=-g -O2 -pipe '
CONFIGURE_PATH /etc/ImageMagick/
COPYRIGHT Copyright (C) 1999-2012 ImageMagick Studio LLC
CPPFLAGS -I/usr/include/ImageMagick
CXX g++
CXXFLAGS -g -O2 -pipe
DEFS -DHAVE_CONFIG_H
DELEGATES autotrace bzlib fftw fpx fontconfig freetype gs jbig jpeg jng jp2 lcms2 lzma png rsvg tiff x11 xml zlib
DISTCHECK_CONFIG_FLAGS 'CC=gcc' 'CFLAGS=-g -O2 -pipe ' 'CPPFLAGS=' 'CXX=g++' 'LD FLAGS=' 'LIBS=' --disable-deprecated --with-quantum-depth=16 --with-umem=no --wi th-fontpath=/usr/share/fonts --with-gs-font-dir=/usr/share/ghostscript/fonts --w ith-lcms=no --with-windows-font-dir=/usr/share/fonts/TTF --with-wmf=no
DOCUMENTATION_PATH /usr/share/doc/ImageMagick/
EXEC-PREFIX /usr
EXECUTABLE_PATH /usr/bin
FEATURES OpenMP
FILTER_PATH /usr/lib/ImageMagick-6.7.6/modules-Q16/filters
HOST i686-pc-cygwin
INCLUDE_PATH /usr/include/ImageMagick
LDFLAGS -L/usr/lib -L/usr/lib
LIB_VERSION 0x676
LIB_VERSION_NUMBER 6,7,6,3
LIBRARY_PATH /usr/lib/ImageMagick-6.7.6
LIBS -lMagickCore -ljbig -llcms2 -ltiff -lfreetype -ljasper -ljpeg -lgs -lpng14 -Wl,--enable-auto-import -fopenmp -lautotrace -lfreetype -lMagickWand - lMagickCore -lming -lm -lpstoedit -lpng -lz -lstdc++ -ldl -lfftw3 -lfpx -lfontco nfig -lexpat -lfreetype -lz -lbz2 -liconv -lXext -lXt -lSM -lICE -lX11 -llzma -l bz2 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpixman-1 -lpng14 -lxcb-shm -lxcb-r ender -lXrender -lX11 -lxcb -lXau -lXdmcp -lpango-1.0 -lm -lfontconfig -lexpat - lfreetype -lz -lbz2 -lgobject-2.0 -lffi -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 - lintl -liconv -L/usr/bin -lrsvg-2 -lgio-2.0 -lgdk_pixbuf-2.0 -lm -lcairo -lgmodu le-2.0 -lgobject-2.0 -lffi -lpixman-1 -lfontconfig -lexpat -lfreetype -lbz2 -lpn g14 -lz -lxcb-shm -lxcb-render -lXrender -lgthread-2.0 -lglib-2.0 -lintl -liconv -lX11 -lxcb -lXau -lXdmcp -lxml2 -lz -lgdi32 -lm -lgomp -lpthread -lltdl
NAME ImageMagick
PCFLAGS -fopenmp
PREFIX /usr
QuantumDepth 16
RELEASE_DATE 2012-04-01
SHARE_PATH /usr/share/ImageMagick-6.7.6
SVN_REVISION 7291
TARGET_CPU i686
TARGET_OS cygwin
TARGET_VENDOR pc
VERSION 6.7.6
WEBSITE http://www.imagemagick.org
Path: [built-in]
Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
Code: Select all
#include <iostream>
#include <Magick++.h>
using namespace std;
int main( int argc, char ** argv)
{
InitializeMagick(*argv);
cout<<"Hello Magick++"<<endl;
return 0;
}
Code: Select all
g++ `Magick++-config --cppflags` -o hello hello_world.cpp \ `Magick++-config --ldflags --libs`
Code: Select all
g++: -lMagick++: No such file or directory
cc1plus: warning: command line option "-fopenmp" is valid for D but not for C++
hello_world.cpp: In function `int main(int, char**)':
hello_world.cpp:7: error: `InitializeMagick' undeclared (first use this function)
hello_world.cpp:7: error: (Each undeclared identifier is reported only once for each function it appears in.)
THANK YOU!!