Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

c++ - How boost auto-linking makes choice?

When I use Visual Studio 2012, with auto-linking, I don't need to add boost / POCO/ python libraries manually, they would be added automatically. And if I miss any library, I get message like that:

LINK : fatal error LNK1104: cannot open file 'libboost_system-vc110-mt-1_55.lib'

But how it knows which file I want to link? Maybe I want to link dynamically, using boost_system-vs110-mt-1_55.lib, or I want one with gd or sgd in name?

How it makes choice?

Problem is, that my program is looking for libboost_ ... (i.e. static) libraries, when search for system, threads and etc, but it wants boost_ (i.e. dynamic) for python, and I just don't understand why?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Visual Studio allows #pragma directives in the source code to set linker options. For "auto-linking", Boost uses these #pragma's in combination with existing macro's.

In particular, it sounds like you are looking for the BOOST_ALL_DYN_LINK macro.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...