Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linker requires versions of compiler and Boost in the names of lib-files. fatal error LNK1104

To install boost I run

b2 install optimization=speed variant=debug,release --layout=tagged --prefix=BOOST_DIR

Names of lib-files look like

...
libboost_serialization-mt.lib
libboost_serialization-mt-gd.lib
...

When project is linking I get error

LINK : fatal error LNK1104: cannot open file 'libboost_serialization-vc140-mt-gd-1_62.lib'

This file is not set in project settings with any names, only directory of this file is set. The project is linking successfully if I add compiler and Boost versions to the file name.
Can I make the project no need of Boost lib-files renaming when I install new version of Boost?

like image 345
Ufx Avatar asked Sep 29 '16 23:09

Ufx


1 Answers

When building boost with the --layout=tagged option, you have to define BOOST_AUTO_LINK_TAGGED before including any boost header to allow auto-linking to work correctly. Otherwise, disable auto-linking by defining BOOST_ALL_NO_LIB and explicitly specify the library.

like image 106
Robert Prévost Avatar answered Nov 14 '22 21:11

Robert Prévost