The linker needs the compiler and Boost versions in the names of the lib files. fatal error LNK1104

To install boost, I run

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

Lib file names look like

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

When a project binds, I get an error

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

This file is not specified in the project settings with any names; only the directory of this file is set. The project successfully binds if I add compiler and Boost files to the file name.
Can I make a project no need to rename Boost lib files when installing a new version of Boost?

+5
source share
1 answer

When creating a boost with the --layout=tagged option, you must define BOOST_AUTO_LINK_TAGGED before including any boost header to enable auto-binding to work correctly. Otherwise, turn off auto-binding by specifying BOOST_ALL_NO_LIB and explicitly specifying a library.

+5
source

Source: https://habr.com/ru/post/1257482/


All Articles