Cannot link Boost regex

前端 未结 1 528
感情败类
感情败类 2021-02-13 23:15

I am currently trying to compile a Contraction Hierachies implementation by KIT which requires Boost::Regex. The supplied Makefile already makes sure (and I have also double-che

相关标签:
1条回答
  • 2021-02-14 00:19

    Linker switches are in the wrong order. make tries to do this:

    g++ -lboost_regex -lboost_iostreams -o main main.o
    

    This is what actually works (at least with gcc 4.8.1):

    g++ -o main main.o -lboost_regex -lboost_iostreams
    

    So to fix the compilation error you should substitue line 6 in the Makefile with the following:

        $(CXX) -o $@ $^ $(LIBS) $(LINK)
    
    0 讨论(0)
提交回复
热议问题