Conflict between Boost, OpenCV and Eigen libraries?

后端 未结 1 1825
离开以前
离开以前 2020-12-19 04:13

my question is somewhat related to Static linking of Boost and OpenCV libs with Eclipse CDR. errors, whereas I\'m trying to do a bit more than described here: How to create

1条回答
  •  情深已故
    2020-12-19 05:01

    Using the boost::filesystem namespace before including Eigen causes the compiler to fail:

    #include 
    using namespace boost::filesystem;
    #include 
    

    fails, but

    #include 
    #include 
    using namespace boost::filesystem;
    

    works.

    The reason is that if boost::filesystem is added to the global namespace, it pollutes it, and causes some code (here: eigen) that depends on unpolluted namespace to cause errors during compilation. There's nothing strange about it. Normally you should never put "using" lines before your includes are finished.

    0 讨论(0)
提交回复
热议问题