gnuplot-iostream示例不能用c11编译

时间:2013-09-29 18:51:54

标签: c++11 gnuplot

我修改了Makefile,将-std = c ++ 11和-stdlib = libc ++添加到CXXFLAGS& LDFLAGS变量,它停止编译时出现以下错误:

$ make
c++ -Wall -Wextra -O0 -g -std=c++11 -stdlib=libc++ -c example-misc.cc -o example-misc.o
c++ -o example-misc example-misc.o -lutil -lboost_iostreams-mt -lboost_system-mt -lboost_filesystem-mt -std=c++11 -stdlib=libc++
Undefined symbols for architecture x86_64:
"boost::iostreams::file_descriptor::seek(long, std::__1::ios_base::seekdir)", referenced from:
  std::__1::fpos<__mbstate_t> boost::iostreams::detail::seek_device_impl<boost::iostreams::any_tag>::seek<boost::iostreams::file_descriptor_sink>(boost::iostreams::file_descriptor_sink&, long, std::__1::ios_base::seekdir, unsigned int) in example-misc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [example-misc] Error 1    

有人知道如何解决这个问题吗?

修改 通过使用c11标志重新安装boost来解决问题:

brew reinstall boost --with-c++11

0 个答案:

没有答案