0

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
4

0 に答える 0