undefined reference to `boost::system::generic_category()
生活随笔
收集整理的這篇文章主要介紹了
undefined reference to `boost::system::generic_category()
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
報錯大致如下:
main.cpp:(.text+0x49): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x53): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x5d): undefined reference to `boost::system::system_category()'
當時搞了很久,各種庫各種一通鏈接,始終沒解決問題
解決方案:
"boost/filesystem.hpp" 這個文件依賴于boost_system,編譯的時候,需要 -lboost_system選項,但是你的編譯選項里頭已經指定該選項,為什么還會出現鏈接錯誤呢。我也納悶了半天,后來發現,原來是-l選項的順序問題。在g++的man幫助信息里面,我發現了下面的話:
引用g++ main.cpp -lboost_system -lboost_filesystem
總結
以上是生活随笔為你收集整理的undefined reference to `boost::system::generic_category()的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 为什么虚拟机的linux系统IP是10.
- 下一篇: ssh 远程登录不用密码 ssh-key