这可能很简单,但我无法弄清楚。
在我的 main.cpp 我有:
Image image("/path/to/image.png");
int* h = ImageProcessor::dailyPrices(image);
在我的 ImageProcessor.h 中,我有:
//Maybe something is wrong with this? I am trying to forward declare.
namespace Magick
{
class Image;
}
class ImageProcessor {
public:
ImageProcessor();
virtual ~ImageProcessor();
static int* dailyPrices(const Magick::Image& abp_chart);
};
在 ImageProcessor.cpp 我有
int* dailyPrices(const Image& abp_chart)
{
但是在尝试编译时,我在 main.cpp 中收到以下错误:
path/to/VendBot.cpp:17: undefined reference to `ImageProcessor::dailyPrices(Magick::Image const&)'