C++ BOOST undefined reference to `boost::filesystem::detail::copy_file

前端 未结 4 585
执笔经年
执笔经年 2020-12-15 04:34

I have no clue why boost::filesystem::copy_file is making trouble for me.

undefined reference to `boost::filesystem::detail::copy_file

4条回答
  •  Happy的楠姐
    2020-12-15 05:32

    I could not compile a file that included the header boost/filesystem.hpp either. This is how I solved it: I commented out the line boost/filesystem.hpp and all the lines that were using Boost, and then compiled the file. I then uncommented all the lines in the files and compiled again, and then it worked. I was compiling with the flag -lboost_system both times!

提交回复
热议问题