Ada Extension for Visual Studio 2019 - ada

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

Related

MPI with MinGW and Eclipse

My question is devided in two parts :
What is the best combination to execute MPI program in C language, when i searched for the necessary tools i found who work with Visual Studio and MS-MPI , and who work with Eclipse PTP or Code::Blocks and MPICH2 MPIOpen so i didn't know what to choose and what are tools that are compatible which other?
So ive installed OpenMPI,Eclipse PTP (Kepler) and MinGW-w64 to compile some C programs using MPI on windows 7 64Bits. i set all paths such as mpicc.exe i tried to test the Hello world program which is include with eclipse as example, i got this error:
13:03:48 **** Incremental Build of configuration Debug for project A ****
Info: Internal Builder is used for build
mpicc "-IC:\Program" Files "(x86)\OpenMPI_v1.6.2-x64\include" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\A.o" "..\src\A.c"
The Open MPI wrapper compiler was unable to find the specified compiler
cl.exe in your PATH.
Note that this compiler was either specified at configure time or in
one of several possible environment variables.
13:03:48 Build Finished (took 115ms)
So i searched for cl.exe in my computer but i didn't found it, when i looked for some solution i found that the majority who solved this cl.exe problem are using visual studio, which is not my case so am little bit confused i dont want to switch to Visual Studio, so any solution with the tools that am using ?
OpenMPI does not appear to officially support MinGW as a backend: https://www.open-mpi.org/software/ompi/v1.6/ms-windows.php
The installers were configured with CMake 2.8.1 and compiled under Visual Studio 2010, and they support for C/C++ compilers of Visual Studio 2005, 2008 and 2010.
https://www.math.ucla.edu/~wotaoyin/windows_coding.html and other sources found on a search describe workflows using MS-MPI with MinGW. It may be a viable alternative. VSCode and MPI in WSL describes yet another non-paid but proprietary approach using VSCode with the WSL plugin.

Building Qt project with cmake

Just installed QT and trying to build a QT project from inside the QTcreator using Cmake instead of Qmake.
I get the following error:
Starting to parse CMake project, using: "DCMAKE_BUILD_TYPE:STRING=Debug",
"-DCMAKE_CXX_COMPILER:STRING=",
"-DCMAKE_C_COMPILER:STRING=",
"DCMAKE_PREFIX_PATH:STRING=C:/Qt/5.13.1/msvc2015_64",
"DQT_QMAKE_EXECUTABLE:STRING=C:/Qt/5.13.1/msvc2015_64/bin/qmake.exe".
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the JOM generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
Configuring incomplete, errors occurred!
See also "C:/Users/tany/AppData/Local/Temp/QtCreator-pKrFgC/qtc-cmake-DqmsxZqd/CMakeFiles/CMakeOutput.log".
See also "C:/Users/tany/AppData/Local/Temp/QtCreator-pKrFgC/qtc-cmake-DqmsxZqd/CMakeFiles/CMakeError.log".
CMake Deprecation Warning:
The 'cmake-server(7)' is deprecated. Please port clients to use the
'cmake-file-api(7)' instead.
CMake Project parsing failed.
Now if I use the Cmake-GUI instead, I can configure and generate the project files successfully, after supplying the environment variable CMAKE_PREFIX_PATH.
But I can't get this to work from inside the QTcreator.
Anyone has any experience with using Cmake with QTcreator then please help.
Thank you!
The error message says that your C++ compiler Visual Studio 2015 (64 bits) could not be located. Maybe when you run cmake-gui it finds another C++ compiler like mingw?
In Qtcreator's settings dialog you have a tab showing the detected compilers, and another one with the available kits.
It seems that QtCreator is using a deprecated version of cmake. Update QtCreator to a new (unreleased, as writing this comment, version 4.10.0 is broken) or downgrade cmake to choco.exe install cmake --version 3.11 --force (a newer version might work).
Please also make sure to install jom (as this is the default for QtCreator/CMake on windows).
choco.exe install jom (how can I tell it to use make?)
The deprecation warning is harmless. CMake deprecated the cmake-server and provides a new API for the same purpose now. Qt Creator will support that from 4.11.
The error tells you, that CMake is unable find the cl compiler. cl.exe comes with Visual Studio. Make sure you mark C++ there during the installation process. It is not installed by default anymore.
Alternatively install the MinGW tool chain from the Qt installer. In Qt context it is easier to use than the Visual Studio tool chain.

QtCreator with BlackBerry Z10

I installed BlackBerry NDK including IDE and downloaded the SDK. Now, I already set up Qt-Creator 2.8.1, 2.8.0, 2.6.2... In every version there is another problem with the build settings. The most appropriate try was with 2.6.2 and manually setting up the BB10 integration.
BB10 NDK Version: 10.1 for Target 10.1.0.4633 armv7le-v7
Creator is always started with bbnk-env.bat called before.
2.6.2:
Compiler set to GCC with custom-arm-linux-generic-elf-32bit as proposed by https://developer.blackberry.com/native/documentation/core/qt_porting_tools.html
(I do have a second compiler set to unix instead of linux)
QT-Version provided by Blackberry NDK, Qt 4.8.5 within %BBNDK%\host_10_1_0_238\win32\x86\usr\bin\qmake.exe.
Devices: BBZ10 is connected and accessible. QtCreator successfully connects and can use the debugToken.
Now the problem is within the Kits: Created a kit for BBZ10, having the bbZ10 Device, bbndk\target_10_1_0_4633\qnx6\armle-v7 as sysroot, compiler (set for linux), gdb to ntoarm-gdb.exe, QT-Version to configured 4.8.5. I can now try any mkspec it always gives me the error (translated from german)
No mkspec found for given QT Version
Für diese QT Version wurde keine mkspec gefunden
I think the mkspecs are set to compile to unix-target, while the 4.5qt supplied with the sdk requires to be linux target (where in reality target is QNX)
Somehow i can compile with this version, but first i am not sure if this creates a correct executable, even more i cannot deploy the executable, since QT-Creator does not create the bar-descriptor.xml file...
2.8.1:
Using the same setup as in 2.6 (after having 2.6 QT Version configured) i am able to get to the same error. Using the "new" configuration system under "BlackBerry" page in settings i cannot correctly set up NDK Path. Will always tell me (translated from german)
Following problems were encountered during BB10 configuration:
No QT-Version found
No GCC compiler found
No GDB Debugger for BB10 Comiler found
No GDB Debugger for BB10 Simulator found
Has anyone successfully configured bb10 ndk to use with qt-creator (2.6/2.8.1) and encountered similar trouble?
How can i solve this issue?
Solved:
After 24 hours trying, installing, reinstalling, editing, crying... I reinstalled complete NDK and QtCreator 2.8 and edited bbndk-env_10_1_0_4633.bat.
I removed every Variable from batch file and set it to corresponding values, e.g. replace every %BASE_DIR% with your acutal base-dir (i.e. D:\bbndk).
For conveniance usage i craeted another batchfile, calling the bbndk-env batch and starting qt-creator.
Set Compiler, Qt-Version, Kits in Creator-Settings as described in https://developer.blackberry.com/native/documentation/core/qt_porting_tools.html
Keep mkspecs line under Kits-tab empty
Thank You

Qt 4.8.3 installation on Windows 7 & QtWebkit problems

I just updated my Qt to 4.8.3, because the program built from older version is not compatible to the new framework.
So I have to upgrade.
This process was frustrating and time consuming. So many problems came out.
I download Qt from this url:
http://qt-project.org/downloads
At beginning, I installed the MinGW one (I'm not a fan of MSVC).
I tried the newest ( I think it's 4.6) version of MinGW and order version (4.4).
However, after I installed MinGW and tried to install Qt 4.8.3, during the process, the following message shows up:
There is a problem with your MinGW installation:
The installer could not find a valid C:\MinGW\include\w32api.h (Only versions with W32API 3.13 are supported)
Do you still want to continue? (Your installation may not work)
The 4.6 version does have this w32api.h file, I don't know what's going on. And I have trouble finding MinGW 4.4 with this head file.
I decide to ignore this warning and continue to install Qt and Qt creator. After that,
I opened my current project, configure it (why the configuration become so complex...), I tried to build it.
Then the following message shows up because some external lib I used requires Exception Handling:
exception handling disabled, use -fexceptions to enable
And I don't know how to enable the it.
I tried to add -fexceptions flag in QMAKE_CXXFLAGS but it doesn't work.
By the way, I tried the VC version of Qt too, but I used the MinGW before and the VC compiler is quite different, if I use VC version, it will take a lot of time to make it compilable by VC compiler.
Does anyone know how to install Qt 4.8.3 on Windows? my project works fine before, now I just want to compile it successfully.......
These are not the only problem.
I updated the Qt on Mac machine too, it is easier to have the compiler work since it's unix base.
However, I used QtWebkit lib in my project and obviously, they changed this lib and it's not compatible to order version.
I can compile my project on Mac, however, every time I run it, following massage shows up and the program stopped.
dyld: Symbol not found: _OBJC_CLASS_$_CALayerHost Referenced from:
/Library/Frameworks/QtWebKit.framework/Versions/4/QtWebKit Expected
in:
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
The program has unexpectedly finished.
Does any one know how to solve this QtWebKit problem? I'll really appreciate.
I remembered that when Qt is under nokia, it's so easy to install and use, the Qt SDK is perfect.
I really hate the change made after it was bought by digia.........
I found solutions of my first two problems:
for the first problem, as I described, download the MinGW provided by Nokia Qt
ftp.qt.nokia.com/misc/MinGW-gcc440_1.zip [ftp.qt.nokia.com]
Tried several versions of MinGW 4.4, I think this is the only one works.
About the second problem, add following configure in the project file:
CONFIG += exceptions
Now the QWebKit problem is only one unsolved.
Is it all relevant that your include directory for MinGW has two "i's" in it or was that a typographic error when posted on SO? See:
The installer could not find a valid C:\MinGW\iinclude\w32api.h

compiling QT 4,8,0 in windows 7 x64 with visual studio 2010 gives makefile not found

i have a problem.. i'm trying to compile qt for vs 2010..
But i can't..
i'm following this guide:
http://thomasstockx.blogspot.com/2011/03/qt-472-in-visual-studio-2010.html
i follow all the steps (with the exception of -shared config, because i want -static) but when i digit nmake the vs prompt tell me this:
Microsoft (R) Program Maintenance Utility versione 10.00.30319.01
Copyright (C) Microsoft Corporation. Tutti i diritti riservati.
NMAKE : fatal error U1064: MAKEFILE non trovato. Nessuna destinazione specificat
a.
Stop.
c:\Qt\4.8.0>
it didn't find the makefile... i try with 2 different pcs with the same version of qt, vs and windows and in both don't work so i do something wrong.. but i can't understand where..i triedsearching but with no luck...
Thanks in advance...
I would definitely install Perl and try again. If it's not needed why should it give that message at all?
However, I don't seem to remember I had Perl installed so the error is rather strange.
The tutorial was written originally for Qt 4.7.2 and worked up to 4.7.4.
But I haven't tested it with 4.8. Before 4.8, VS2010 just wasn't supported by Qt, this has recently changed, so like Frank said, you should probably try to download the VS2010 packages since they now support it.

Resources