Microsoft Windows [Version 10.0.18362.1082]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\freddie>cd\
C:\>CD C:\Code\CodeBlks\C++\Form1
C:\Code\CodeBlks\C++\Form1>VSCPP.BAT Main gui -m64
Using Visual Studio BuildTools 2019
The system cannot find the path specified.
Compiling "Main.cpp" To
'cl.exe' is not recognized as an internal or external command,
operable program or batch file.
Finished
C:\Code\CodeBlks\C++\Form1>VSCPP.BAT Main -m64 gui
Using Visual Studio BuildTools 2019
The system cannot find the path specified.
Compiling "Main.cpp" To "a Windows Gui App"'cl.exe' is not recognized as an internal or external command,
operable program or batch file.
Finished
C:\Code\CodeBlks\C++\Form1>
The other problem appears to be that vanilla batch file scripting is fundamentally fragile and error-prone.
1 2 3
IF EXIST C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat(
echo hello
}
Appears to print "hello" for me regardless of if the file in question exists. Probably has to do with some combination of spaces and lack of quotes in the filename, and the opening parenthesis.
Microsoft Windows [Version 10.0.18362.1082]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\freddie>cd\
C:\>CD C:\Code\CodeBlks\C++\Form1
C:\Code\CodeBlks\C++\Form1>VSCPP.BAT Main -m64 gui
Using Visual Studio Cummunity 2019
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.5.5
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Compiling "Main.cpp" To "a Windows Gui App"
Main.cpp
Finished
C:\Code\CodeBlks\C++\Form1>
I don't think you hijacked the thread James. Look at it this way...
Alexander's whole problem here seems to be in setting up a Visual Studio C++ project to create a Win32 SDK based Api program. There was nothing at all wrong with the code he posted which he apparently obtained from a tutorial somewhere. So there are two bodies of 'know how' involved 1) C++ coding skills; 2) Knowledge of how to use a complicated IDE and what it does to build a binary. I tested his code to determine if there were any problems with it and there weren't. I mentioned I built the code from the command line, I posted that output, and he asked....
Thanks. I will try Visual Studio 2019, but how do you compile without starting a project?
That's when you posted your original batch file.
I've always thought that folks learning C or C++ ought to become familiar with command line compiling/linking. In 2016 I submitted a tutorial here on that topic. Its still 'awaiting' approval. At this time its outdated as I spent a fair amount of time explaining how to download and install the Windows 7 SDK, and how to use the command line interface to build code. Maybe the administrators here didn't think my tutorial was any good. I never heard from them. I did my best with it.
Maybe the administrators here didn't think my tutorial was any good.
Or maybe the administrators/site owner gave up expanding/updating the site, real life became more important. The last approved article is dated 16 Sept 2016.
Well, that makes me feel a little better coder and Furry Guy. I'm not really very much up on how internet sites work so on and so forth. It must take some effort and expense to keep a site up, doesn't it?
Maintaining a site like CPP -- other than the forum as long as the database of posts stays intact -- is quite a lot of effort, especially if one wants the information to be up-to-date and accurate.
The internet usage bills for the bandwidth consumed are not insignificant either. Also the cost of hosting the site, keeping the domain name active, etc.
And, no, I don't have much of a clue of the administrative details of having an active website as well. :Þ
For a site that APPEARS to be under little to no active maintenance having CPP up and running with no problems (at least to us chickens users) is simply amazing.