0

I'm currently trying to install a simulation package using Visual Studios 19. When I try to build the solution, I get the error message

Error LNK1104 cannot open file 'boost_regex.lib'

I am very new to C++ and installing programs from source codes so maybe this is a easy fix but I just simply don't see it.

I am using Boost v1.59 and I followed the installation guide here. I used the directions given by "5.1 Simplified Build From Source" from that guide.

I know I am probably not providing enough information on the problem, but I just simply don't know enough to know exactly what information to provide. Maybe one of you fine people can ask me a few questions and I'll try to provide answers to the best of my ability. Thanks for helping!

Edit, I have added "C:\Program Files\boost\boost_1_59_0\stage\lib\" to my Additional Library Directories under Linker

patrick7
  • 366
  • 1
  • 11
  • I expect `boost_regex.lib` does not exist in that folder. I expect the naming to be different. – drescherjm May 07 '20 at 00:29
  • You are correct. I just noticed that under the directory C:\Program Files\boost\boost_1_59_0\stage\lib\ there are two flies that contains the word regex. libboost_regex-vc140-mt-1_59.lib and libboost_regex-vc140-mt-gd-1_59.lib. I tried changing the name in my Linker setting under Input - > Additional Dependencies, but I still get the error cannot open file 'boost_regex.lib' – patrick7 May 07 '20 at 00:32

1 Answers1

0

Whoever created the VS solution has set things up to expect non-mangled library names, if you build boost with

./b2 --with-regex --layout=sytem release

Then you will get binaries with the name that your project is expecting. Please note however that this is somewhat dangerous - it's very easy to end up linking incompatible binaries this way with either inscrutable linker errors, or strange runtime failures. Pay close attention to any linker warnings you may get!

John Maddock
  • 111
  • 1
  • 2