In order to compile a C++ project I need to first run this in the command line:
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
then call emacs from that same command line, then compilation mode recognizes cl compiler command. How can I configure emacs so that I don't need to run it from a command line, instead this would be initialized for compilation mode so that it recognizes cl.
In order to compile a C++ project I need to first run this in the command line:
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
then call emacs from that same command line, then compilation mode recognizes cl compiler command. How can I configure emacs so that I don't need to run it from a command line, instead this would be initialized for compilation mode so that it recognizes cl.
Share Improve this question asked Jan 29 at 11:24 o_luka02o_luka02 33 bronze badges 12 | Show 7 more comments1 Answer
Reset to default 0Applying user7860670's idea, I was able to achieve the desired functionality (even though my original question asked for something else), although now compilation is slower by about 1-2 seconds. Add code that initializes environment at the beginning of your build script, in my case I added:
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
But this will run with every compile making it a bit slower.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745302139a4621499.html
vcvarsall.bat
command and starts Emacs. Create a shortcut to it on your desktop. Now you can run it as any other program by double-clicking its icon. – Some programmer dude Commented Jan 29 at 11:32