J'essaie actuellement de compiler un simple code C++ avec l'API Magick ++. Le code que je suis en train de créer est simple. Juste un "hello world" aveC#include Magick ++. H en haut.Impossible de compiler du code avec Magick ++ (problème de bibliothèque)
Le problème est que le compilateur ne peut pas trouver -lMagick ++. Voir l'erreur ci-dessous
ImageMagick a été installé à partir de fichiers binaires dans Cygwin sur Windows 7. Je ne la configuration suivante après l'installation
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"
fichier CPP:
#include <iostream>
#include <Magick++.h>
using namespace std;
int main(int argc, char ** argv)
{
InitializeMagick(*argv);
cout<<"Hello Magick++"<<endl;
return 0;
}
Compilé avec:
g++ `Magick++-config --cppflags` -o hello hello_world.cpp \ `Magick++-config --ldflags --libs`
Qui crache en arrière:
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.)
Veuillez montrer la sortie de 'Magick ++ - config --cppflags' et' Magick ++ - config --ldflags --libs' – iehrlich
D'où vient le '-fopenmp'? –