fatal error LNK1104: cannot open file 'libboost_regex-vc90-mt-gd-1_42.lib'

前端 未结 4 2016
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 15:34

i\'m trying to use boost regex within my program the problem is i get this error... the only installation step i did was to add: \"C:\\Program Files\\boost\\boost_1_42\" int

4条回答
  •  长情又很酷
    2020-12-29 16:34

    Some Boost libraries have to be built; this is one of them. Here's how you can build them:

    Make a new file called boost_build.bat, and inside put:

    bjam toolset=msvc-9.0 variant=release threading=multi link=static define=_SECURE_SCL=0 define=_HAS_ITERATOR_DEBUGGING=0
    bjam toolset=msvc-9.0 variant=debug threading=multi link=static
    

    Note 9.0 refers to VS 2008. (10.0 for 2010, 8.0 for 2005, 7.1 for 2003, 6.0 for, well, 6.0). Once you've done this:

    1. Extract build_boost.bat to

    2. Go to: \tools\jam And run build_dist.bat

    3. Copy \tools\jam\stage\bin.ntx86\bjam.exe to

    4. Run boost_build.bat

    5. Libraries are located in \stage\lib

    Note, this is my own method. I would love if someone chimed in an easier way, or some link from Boost; it seems it's difficult to find proper build instructions from Boost.

    Once it's built, make sure you let the compiler know where the libraries are in your VC Directories (the Library Paths); add "\stage\lib".


    In the bjam defines, I have _SECURE_SCL=0 _HAS_ITERATOR_DEBUGGING=0 for Release. This disables all iterator checking in Release builds, for a speed improvement.

提交回复
热议问题