Can't link program using Boost.Filesystem

前端 未结 5 772
陌清茗
陌清茗 2020-12-06 00:18

I\'m trying to run program, using sample code of boost::filesystem on Ubuntu 12.10, but it doesn\'t want to build.

#include 
#include 

        
5条回答
  •  执念已碎
    2020-12-06 00:43

    You need to add libboost_filesystem library when linking. Or libboost_filesystem-mt if your application is multi-threaded. Like this:

    g++ -o file -lboost_filesystem-mt source_file.cpp
    

提交回复
热议问题