-
April 12th, 2018, 08:09 AM
#1
[RESOLVED] Visual Studio update breaks my batch file compiling
FYI:
I compile most all my c/c++ code using batch files.
My ide sets environment vars before calling the batch file.
I set INCLUDE to point to my personal include folder and with prior versions this worked fine.
I recently updated my Visual Studio 2017 community and now it cannot find my include folder.
I have another environment var MYINC that also points to my include file.
By using cl.exe /I%MYINC% ...... in the batch files it now works as expected.
It is probably something I should have done in the first place but .....
James
-
April 12th, 2018, 07:58 PM
#2
Re: Visual Studio update breaks my batch file compiling
Originally Posted by jcfuller
FYI:
I compile most all my c/c++ code using batch files.
My ide sets environment vars before calling the batch file.
I set INCLUDE to point to my personal include folder and with prior versions this worked fine.
I recently updated my Visual Studio 2017 community and now it cannot find my include folder.
I have another environment var MYINC that also points to my include file.
By using cl.exe /I%MYINC% ...... in the batch files it now works as expected.
It is probably something I should have done in the first place but .....
James
Are you running the batch file from a Visual Studio command prompt?
-
April 13th, 2018, 05:07 AM
#3
Re: Visual Studio update breaks my batch file compiling
Originally Posted by Arjay
Are you running the batch file from a Visual Studio command prompt?
No I am not. I shell to cmd.exe from my editor. I have been running this way with VS 2013,2015,and 2017 without problems until the last VS 2017 update.
James
-
April 13th, 2018, 05:33 AM
#4
Re: Visual Studio update breaks my batch file compiling
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
April 13th, 2018, 08:59 AM
#5
Re: Visual Studio update breaks my batch file compiling
Originally Posted by 2kaud
No I have not because here:
https://docs.microsoft.com/en-us/cpp...ment-variables
it says
INCLUDE, which must point to the \include subdirectory of your Visual C++ installation
So I figured I may have been using it in an undocumented way and for some unknown reason it was working??
Everything is fine now by adding the /I%MYINC% in my batch files. This was more of an FYI post just in case others were having issues. I doubt very many coders use batch files with the latest Visual Studio c/c++ but I thought I'd pass along my findings anyway
James
-
April 14th, 2018, 12:28 PM
#6
Re: [RESOLVED] Visual Studio update breaks my batch file compiling
Looks like Visual Studio has cleaned up what environment variables it sets during installation. I would guess that it sets less system/user variables during a vs install and relies on folks using the visual studio command prompt when they need a VS cmd env. Try typing c:\set from both command prompts (i.e. regular and Visual Studio) and compare the envirinment variables. The vs cmd prompt is simply a batch file that sets extra env variables. If you want the 'older' build experience simply add missing env variables to the system or user settings.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|