Setting the Include Path when Compiling Programs on the Command Line on the VS2015

Asked 2 years ago, Updated 2 years ago, 60 views

I'm trying to build a distributed program using "VS2015 x64 Native Tools Command Prompt".

cd build
qmake
nmake release

Instructions are written as follows:
Apparently using OpenCV and Qt.
As a precaution, it was set to run PATH through the bin folder of OpenCV and Qt, so I set it from the control panel ->system ->Advanced settings to the environment variable.

However, if you execute the command as above, when you execute nmake,
fatal error C1003:Cannot open include file:......
There are a lot of errors.
Neither OpenCV nor Qt seem to pass.

I've only used Xcode and Visual Studio, so I've never set the include or library path on the command line, so I don't know.
How can I set it up?
I would appreciate it if you could let me know.

windows opencv qt

2022-09-30 19:33

1 Answers

You are using the developer command prompt instead of Visual Studio 2015 IDE, so

Visual C++ command-line tools help you locate include files and library files
Some environment variables are referenced.
https://msdn.microsoft.com/ja-jp/library/f2ccy3wt.aspx
According to
Find the header file from the environment variable INCLUDE and the library file from the environment variable LIB.

Shortcuts to developer command prompts set Visual Studio standard INCLUDE LIB
Invoking batch internally.
In this case, I would like to add Qt and OpenCV header libraries to that.

To avoid damaging Visual Studio itself
The vcvars32.bat class in the Visual Studio installation directory remains unchanged. It would be appropriate to add it to the user environment variable for your account.
(Oira is a principle that does not change the system environment variable.)

The specific values are different depending on where Qt and OpenCV are installed on your hard disk, but
Directory with Qt/OpenCV header files in the user environment variable INCLUDE Directory with Qt/OpenCV built library files in the user environment variable LIB You may want to add (or create a new one).

The Visual Studio developer command prompt environment variable setting batch is INCLUDELIB
I will add it without overwriting it.

INCLUDELIB with a batch file to add to
- Every time you launch a developer command prompt, you can run it by hand or
- Create a new shortcut [Qt Developer Command Prompt] and
 The shortcut is %comspec%/kmysetvars.bat and
 Always use [Qt Developer Command Prompt] for Qt development or
There are other ways.


2022-09-30 19:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.