Using MSVC compiler with msys
See original GitHub issueI’ve been having trouble configuring my windows build to use the Visual Studio compiler (cl
) in an msys shell. I’ve tried a variety of configurations and PATH manipulations, but nothing seems to work. Example workflow:
- name: Run batch file and set path
run: |
C:\"Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
echo "/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29910/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
which cl # returns the correct path
- uses: msys2/setup-msys2@v2
with:
update: true
install: >-
base-devel
git
path-type: inherit
- name: Build project
run: |
./coinbrew/coinbrew build my-repo
shell: msys2 {0}
Running this workflow errors because it can’t find the compiler:
checking for icl... no
checking for cl... no
configure: error: Neither MS nor Intel C compiler found in PATH and CC is unset.
Error: Process completed with exit code 1.
I’ve confirmed that the PATH is being preserved with the inherit
parameter, but for some reason my program can’t seem to find the compiler. This configuration work fine on AppVeyor.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (4 by maintainers)
Top Results From Across the Web
Bringing Visual Studio compiler into MSYS2 environment
One solution is to use MSYS2 environment. It's a msys/cygwin-like shell that effectively provides you with a bash shell, and this runs on ......
Read more >Environments - MSYS2
The MSYS environment contains the unix-like/cygwin based tools, lives under /usr and are special in that it is always active. All the other...
Read more >Get Started with C++ and Mingw-w64 in Visual Studio Code
In this tutorial, you configure Visual Studio Code to use the GCC C++ compiler (g++) and GDB debugger from mingw-w64 to create programs...
Read more >Using Visual Studio Code for C++ (Part 1 - Windows, MSYS ...
Installing and using Visual Studio Code and g++ (plus other tools) for (re)learning programming (and some entertainment purposes) - Part 1 - Windows...
Read more >Do libraries compiled with MinGW work with MSVC?
No, libraries compiled on MinGW can't be used with MSVC. The main reasons are: Lack of ABI compatibility. That is to say that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For posterity, here is what my final config looked like:
Why do you want to use MSVC in msys2?