'Ada Extension for Visual Studio 2019
I have VS2019 and you may or may not remember I had massive troubles with GNAT 2021 working a little while ago. I have been running my Ada programs from the GCC command line using GNATMAKE and everything has been working fine.
A few days ago a friend of mine told me their is an extension to use Ada within VS 2019. So - I checked it out, downloaded and installed it. Everything seems to be working, I can make a new Ada project just like I used to in GNAT 2021. I set the path : C:\GNAT\2018\bin : as the path variable. The problem comes when I go to compile my test code. It, for some reason, cannot find the GNAT toolchain and compiler. It has read that I have GPS 2018 installed, I know this because when I hover my arrow over the code in the IDE - it shows the location.
package Ada.Text_IO
C:\GNAT\2018\lib\gcc\x86_64-pc-mingw32\7.3.1\adainclude\
I do not understand how the compiler cannot find the toolchain yet intellisense clearly can. There is hardly any documentation about the extension online at all, and all the download page has is very scant setup info, which just refers to settng the path, which I have done correctly. Here is the actual compiler error message.
Build started...
1>------ Build started: Project: test, Configuration: Debug x64 ------
1>gprconfig: can't find a toolchain for the following configuration:
1>gprconfig: language 'ada', target 'C:\GNAT\2018\bin', default runtime
1>test.gpr:12:09: no compiler for language "Ada", cannot compile "test.adb"
1>gprbuild: *** compilation phase failed
Has anyone here managed to use this extension successfully and get a program to compile? If I compile the same code using GPS 2018 it works without any errors. Any help on working out how the set the toolchain/compiler paths in VS would be really helpful.
Thank you guys.
Skyla x
EDIT
Hey thank you for the comment - I ran the command from the commandline tool within the VS2019 IDE and it asked me to select the compiler I wanted to use, which I did. i entered S to save the selection and it seemed to have displayed what you said in your comment. Do I have to C/P this anywhere?
Sorry I do not know much about config settings. I generally just plug in and go. Here is what I got.
gprconfig has found the following compilers on your PATH.
Only those matching the target and the selected compilers are displayed.
* 1. GNAT for Ada in c:\gnat\2018\bin\ version 2018 (default runtime)
3. GCC-ASM for Asm in c:\gnat\2018\bin\ version 7.3.1
4. GCC-ASM for Asm in c:\gnat\2018\bin\ version 7.3.1
5. GCC-ASM for Asm2 in c:\gnat\2018\bin\ version 7.3.1
6. GCC-ASM for Asm2 in c:\gnat\2018\bin\ version 7.3.1
7. GCC-ASM for Asm_Cpp in c:\gnat\2018\bin\ version 7.3.1
8. GCC-ASM for Asm_Cpp in c:\gnat\2018\bin\ version 7.3.1
9. GCC for C in c:\gnat\2018\bin\ version 7.3.1
10. GCC for C in c:\gnat\2018\bin\ version 7.3.1
11. G++ for C++ in c:\gnat\2018\bin\ version 7.3.1
12. WINDRES for WinRes in c:\gnat\2018\bin\ version 2.28.51.20170529
Select or unselect the following compiler (or "s" to save): s
You can regenerate the same config file in batch mode
with the following command line:
gprconfig --batch --target=x86_64-pc-mingw32 --config=Ada,2018,default,c:\gnat\2018\bin\,GNAT
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
