Problem with openCV cvLoadImage(), cvSaveImage()

Many error occured when I use cvLoadImage(), cvSaveImage().

#include "ofApp.h"
#include <highgui.h>

//--------------------------------------------------------------
void ofApp::setup(){
    IplImage * result = cvLoadImage("a.bmp", 0);

}

========================================================

Undefined symbols for architecture x86_64:
  "Imf::Header::Header(int, int, float, Imath::Vec2<float> const&, float, Imf::LineOrder, Imf::Compression)", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::Header::channels()", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::Channel::Channel(Imf::PixelType, int, int, bool)", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::OutputFile::setFrameBuffer(Imf::FrameBuffer const&)", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::OutputFile::writePixels(int)", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::OutputFile::~OutputFile()", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::FrameBuffer::insert(char const*, Imf::Slice const&)", referenced from:
      cv::ExrDecoder::readData(cv::Mat&) in opencv.a(grfmt_exr.cpp.o)
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::InputFile::setFrameBuffer(Imf::FrameBuffer const&)", referenced from:
      cv::ExrDecoder::readData(cv::Mat&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::InputFile::readPixels(int, int)", referenced from:
      cv::ExrDecoder::readData(cv::Mat&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::ChannelList::insert(char const*, Imf::Channel const&)", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::globalThreadCount()", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::InputFile::InputFile(char const*, int)", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
  "Imf::Slice::Slice(Imf::PixelType, char*, unsigned long, unsigned long, int, int, double, bool, bool)", referenced from:
      cv::ExrDecoder::readData(cv::Mat&) in opencv.a(grfmt_exr.cpp.o)
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::hasChromaticities(Imf::Header const&)", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
  "Imf::Header::~Header()", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::chromaticities(Imf::Header const&)", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
  "Imf::Header::dataWindow() const", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
  "Imf::Chromaticities::Chromaticities(Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&, Imath::Vec2<float> const&)", referenced from:
      cv::ExrDecoder::ExrDecoder() in opencv.a(grfmt_exr.cpp.o)
  "Imf::OutputFile::OutputFile(char const*, Imf::Header const&, int)", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int> > const&) in opencv.a(grfmt_exr.cpp.o)
  "Imf::Header::channels() const", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
  "Imf::InputFile::header() const", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
  "Imf::ChannelList::findChannel(char const*) const", referenced from:
      cv::ExrDecoder::readHeader() in opencv.a(grfmt_exr.cpp.o)
ld: symbol(s) not found for architecture x86_64

I tried different option(i386), but result is same.

My system is OS X 10.11, Xcode 7.1, oF 0.9.0.

we don’t include the image decoders with opecv since they would clash with freeimage the library for lading images we pack which uses the same sublibraries, libpng, libjpg… to uncompress images. if you want to open an image the easiest is to use ofImage to get the pixels and then copy it into an opencv one

Thanks.