Magick ++ undefined reference

时间:2016-03-29 18:32:12

标签: c++ netbeans imagemagick mingw

我下载了Magick ++ MinGW版本。我把它解压缩到MinGW文件夹。我将文件从includes / ImageMagick-6移动到包含,因为当我尝试时它正在抱怨:
#include <ImageMagick-6/Magick++.h>
所以现在我只能写:
#include <Magick++.h>
main.cpp是:

Image image("100x100","black");
image.write("C:/blackness.png");

现在它写了以下错误:

cd 'C:\cprojects\dotmap'
C:\MinGW\msys\1.0\bin\make.exe -f Makefile CONF=Debug
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/cprojects/dotmap'
"/C/MinGW/msys/1.0/bin/make.exe"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/dotmap.exe
make.exe[2]: Entering directory `/c/cprojects/dotmap'
mkdir -p dist/Debug/MinGW-Windows
g++ -static-libgcc -static-libstdc++    -o dist/Debug/MinGW-Windows/dotmap build/Debug/MinGW-Windows/Cell.o build/Debug/MinGW-Windows/LasHandler.o build/Debug/MinGW-Windows/Point.o build/Debug/MinGW-Windows/main.o 
build/Debug/MinGW-Windows/main.o: In function `main':
C:\cprojects\dotmap/main.cpp:65: undefined reference to `Magick::Color::Color(char const*)'
C:\cprojects\dotmap/main.cpp:65: undefined reference to `Magick::Geometry::Geometry(std::string const&)'
C:\cprojects\dotmap/main.cpp:65: undefined reference to `Magick::Image::Image(Magick::Geometry const&, Magick::Color const&)'
C:\cprojects\dotmap/main.cpp:65: undefined reference to `Magick::Geometry::~Geometry()'
C:\cprojects\dotmap/main.cpp:65: undefined reference to `Magick::Color::~Color()'
C:\cprojects\dotmap/main.cpp:69: undefined reference to `Magick::Image::write(std::string const&)'
C:\cprojects\dotmap/main.cpp:65: undefined reference to `Magick::Image::~Image()'
C:\cprojects\dotmap/main.cpp:49: undefined reference to `Magick::Geometry::~Geometry()'
C:\cprojects\dotmap/main.cpp:49: undefined reference to `Magick::Color::~Color()'
C:\cprojects\dotmap/main.cpp:65: undefined reference to `Magick::Image::~Image()'
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/dotmap.exe] Error 1
make.exe[2]: Leaving directory `/c/cprojects/dotmap'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/cprojects/dotmap'
make.exe": *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 17s)

谷歌在magick++ undefined reference上放弃的内容并没有帮助。 我需要做些什么来解决这个问题?

更新
我已添加到链接器:-lMagick++-6.Q16.dll -lMagickCore-6.Q16.dll -lMagickWand-6.Q16.dll现在未定义的引用已解决,构建成功。但是在运行中它说:error while loading shared libraries: ?: cannot open shared object file: No such file or directory

0 个答案:

没有答案