linking boost in 64-bit program VS2015

I am in the process of upgrading a big boost-intensive program to VS2015, and boost 1.61. The program is a 64-bit program - x64

Boost seems to look for the wrong libraries in 64-bit mode (Or more likely I did something stupid). I believe I have built the correct boost libraries for the VS2015 platform.

I tried from scratch making a tiny boost function in WIN32 mode, that requires static linking. This works fine......

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

void test()
{
 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;
  }
}

But when I want to compile this in x64 boost complains. Yes I have set the #include and link path correctly for both platforms. The libraries are not there.

1>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc140-mt-gd-1_61.lib'

libboost_regex-vc140-mt-1_61.lib

Upvotes: 0

Views: 1121

Answers (2)

GrafikRobot
GrafikRobot

Reputation: 3059

You need to build the correct set of libraries the compiler is asking for. You should consult the library naming chart to get the build arguments (i.e. properties) to use while building. In your case it's looking for libraries tagged as "lib--mt-gd-1_61.lib". Which reading the chart says you would need to build with:

link=static threading=multi runtime-debugging=on variant=debug

Upvotes: 0

Jepessen
Jepessen

Reputation: 12425

  1. Check if you've built boost at 64 bit
  2. Check if you've added boost library folder to che Visual studio project (Properties->Linker->General->Additional Library Folder)
  3. Check if you're building your solution at 64 bit
  4. If you're not using auto linking, chech if you've added the library dependency in project (Properties->Linker->Input->Additional Dependencies)

Upvotes: 0

Related Questions