I've got a program written in C++ where I'm generating the color of each pixel mathematically, then writing the image. I figured that Magick++ was the simplest way to do this, so I looked up the API and tried to compile the program. However, it's throwing lots of errors that make it look like the `Magick++-configure ...` line isn't working in gcc, and I don't know why.
Environment: Arch Linux, 'imagemagick 6.5.7.5-1' installed with the package manager. ImageMagick functions work fine from the PHP interface on my webserver.
Command: >$ g++ `Magick++-config --cppflags --cxxflags --ldflags --libs` -o program program.cpp -fopenmp
Error: I get a printout of 'Usage' instructions for Magick++, which basically repeat back to me what I've put in the ` ` line. Then I get all sorts of undefined references to Magick functions that indicate it isn't being built with the library. Ex. "undefined reference to `Magick::Color::~Color()' "
As a note, none of the calls to the Magick++ functions are in threaded blocks, only my generation code is.
Does anyone have any ideas for what I can do to fix this?
Thanks!
Compile errors with Magick++
Re: Compile errors with Magick++
This is the command we use:
- g++ `Magick++-config --cxxflags --cppflags` -o magick++ magick++.cpp `Magick++-config --ldflags --libs`
- Magick++-config --cxxflags --cppflags
- Magick++-config --ldflags --libs
Re: Compile errors with Magick++
Thanks, that lets it compile. I still get the echo of the 'usage instructions' for Magic++-config, but no errors and the program works.magick wrote:This is the command we use:
- g++ `Magick++-config --cxxflags --cppflags` -o magick++ magick++.cpp `Magick++-config --ldflags --libs`