linking to boost regex in gcc

前端 未结 2 1663
醉梦人生
醉梦人生 2020-12-18 01:35

i am trying to compile my program which uses regex on linux. I built the boost library in the libs/regex/build by typing make -fgcc.mak which created a directory gcc

2条回答
  •  感动是毒
    2020-12-18 02:07

    I also faced similar problems when using boost filesystem. Here's what I needed to do to get it to link statically.

    Excerpt from My Original (problematic) Makefile: LIBS = -static -lboost_filesystem

    Solution: LIBS = -Wl,-Bstatic -lboost_filesystem -lboost_system -Wl,-Bdynamic

    You can view the complete Makefile from http://code.google.com/p/neptuner/source/browse/codebase/trunk/stratego/uboat/Makefile

    Needed to add boost_system to make it link properly. Direct addition/specification of libboost*.a created more problems. Note the -Bdynamic is present to prevent static link of standard libraries.

提交回复
热议问题