So ImageMagick is working fine for me, but I can't figure out how to compile my program. I searched the forums and googled around, but I couldn't find anything. I probably didn't search for the right thing. Anyways, here's the details:
I have a class named minMax, I include it in my main file using #include "minMax.h"
I've compiled it using: $g++ -c minMax.cc
But when I try to link it to the program, I always get errors. Here's what I'm trying right now:
$ g++ main.cpp minMax.o `Magick++-config --cppflags --cxxflags --ldflags --libsls`
I've tried a lot of variation on this, but I can't get it to work. Anyone knows how to do this?
By the way, I've already successfully compiled other programs that don't include an external class.
Thanks!
[Solved] Compiling Program with External Classes
[Solved] Compiling Program with External Classes
Last edited by xc3ll on 2009-10-08T17:59:25-07:00, edited 1 time in total.
Re: Compiling Program with External Classes
This is the command we use to compile Magick++ source:
- g++ `Magick++-config --cxxflags --cppflags` -o magick++ magick++.cpp `Magick++-config --ldflags --libs
Re: Compiling Program with External Classes
I've been able to successfully compile programs that use Magick++ functions. My particular problem is that I don't know how to include other external classes upon compilation. I need to include the class's .o file so I can access that class's functions within my code.
Just to be clear, I have three files:
Main.cpp <-- this is the main file, which uses Magick++ and minMax functions
minMax.cc & minMax.h <-- this is the external class, defining the private & public variables/func
Thank you
Just to be clear, I have three files:
Main.cpp <-- this is the main file, which uses Magick++ and minMax functions
minMax.cc & minMax.h <-- this is the external class, defining the private & public variables/func
Thank you
Re: Compiling Program with External Classes
Ok, I solved my problem. I swear I tried this before, but it worked. I must just be incredibly stupid.
This solved my problem:
g++ `Magick++-config --cxxflags --cppflags` -o Magick main.cpp minmax.cc `Magick++-config --ldflags --libs`
This solved my problem:
g++ `Magick++-config --cxxflags --cppflags` -o Magick main.cpp minmax.cc `Magick++-config --ldflags --libs`