[Solved] Compiling Program with External Classes
Posted: 2009-10-06T18:19:37-07:00
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!
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!