0

I use boost 1.61.0 with cl 19 (visual studio 2015). I built boost libraries from getting start documentation with command line bootstrapand .\b2. This made stage directory with some vc14 prefix libraries.

But when I tried to compile getting start regex program

#include <boost/regex.hpp>
#include <iostream>
#include <string>

int main()
{
    std::string line;
    boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );

    while (std::cin)
    {
        std::getline(std::cin, line);
        boost::smatch matches;
        if (boost::regex_match(line, matches, pat))
            std::cout << matches[2] << std::endl;
    }
}

with this command line compiler settings:

cl main.cpp -I %BOOST_ROOT% -L %BOOST_LIB_14% /EHsc

I get this error:

Link:: fatal error LNK1181: cannot open input file 'C:\local\boost_1_61_0\stage\lib.obj

What is wrong with my try?

EDIT: I changed command line compile to:

cl main.cpp /I %BOOST_ROOT% /link /LIBPATH:%BOOST_LIB_14% /EHsc

Now, I get this error:

LINK: fatal error LNK1104: cannot open file 'libbosst_regex-vc140-mt-s-1_61.lib'
JalalJaberi
  • 2,417
  • 8
  • 25
  • 41

1 Answers1

0

I found the solution.

I had built boost libraries with bootstrap and .\b2 commands. It built mt (multithread) and gd (debug) libraries only.

For static link (s) libraries I tried .\b2 runtime-link=static and that buit 'libbosst_regex-vc140-mt-s-1_61.lib' file and now everything is OK.

I found the point at what's the difference between mt-gd and mt-s library.

Community
  • 1
  • 1
JalalJaberi
  • 2,417
  • 8
  • 25
  • 41