martjno
martjno

Reputation: 4729

Setting compiler and linker directories via pragma in Visual C++

Is it possible in Visual C++ to set additional include directories and additional libary directories in the source code itself, through pragma definitions (similarly to #pragma comment(lib, "xxx.lib") to link specific libs)?

Upvotes: 4

Views: 6291

Answers (3)

Michael Goldshteyn
Michael Goldshteyn

Reputation: 74440

All of these answers are very VERY old. Here is the latest working link to the list of Visual C++ Pragmas, circa 2020 and Visual C++ 2019:

Visual C++ Pragmas

More importantly, once the above link stop working like all links before it, here is the search phrase you can use with Google to find a working link to that page:

"Visual C++" "section pragma"

Here is a link to automate the Google search (which may also stop working in the future, but you can always resort to the above search text and do the search manually):

Google search for: "Visual C++" "section pragma"

Upvotes: 1

T.E.D.
T.E.D.

Reputation: 44814

The latest list of available pragmas for Visual C++ is available here. I don't see anything there for specifying library paths or anything else like that.

Upvotes: 6

Nikola Smiljanić
Nikola Smiljanić

Reputation: 26863

There is no way to do this. This is the list of all supported pragma directives.

Upvotes: 1

Related Questions