No compiler for language "Ada" when trying to compile for STM32 - ada

I installed GNAT Community edition on Windows and I'm trying to write Ada code, compile it and flash it to STM32 Nucleo.
I started by compiling "hello world" project and compiler works fine, but when I opened an example project for STM32 from the AdaCore/Ada_Drivers_Library (Github) and tried to Build it I got the "No compiler for language "Ada" error.
The path to the compiler is in the envrironment variables.
In the GNAT Studio in Settings the "Compiler Path" and "Tools Path" have the same path, which is C:\GNAT\2020\bin and I checked the "Use the compiler in tools path to generate cross-reference files".
NOTE: in the installation proccess of AdaCore/Ada_Drivers_Library one installation step failed, it was the "python ./scripts/install_dependencies.py". I'm not sure if that's the problem.
Any help appreciated.

Related

QT: fatal error C1083: Cannot open include file: 'type_traits'

I've been spending almost all day trying to get QT installed on my windows machine. I have installed QTCreator with QT 5.14.1 and QWT 6.1.3 (have also tried 6.2.0) and following these instructions with QWT: https://qwt.sourceforge.io/qwtinstall.html
Everything goes fine until I get to the same point where after running nmake it prints:
qwt.cpp
..\..\..\Qt\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\qglobal.h(45) : fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
qwt_abstract_scale_draw.cpp
..\..\..\Qt\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\qglobal.h(45) : fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
qwt_bezier.cpp
..\..\..\Qt\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\qglobal.h(45) : fatal error C1083: Cannot open include file: 'type_traits': No such file or directory
My path variables show that the include directory where type_traits exists is most definitely there.
Any pointers would be great. I'm not sure what else I can possibly do. I've uninstalled and reinstalled my entire .net framework, same with QT.
I ended up solving this, and it turned out to be an issue with the compilers I was selecting. I figure this could help people down the line so I will post what I documented on my company portal - the instructions I have written are as follows:
=====
Realistically, it doesn't matter which kit you select, as long as the compiler and QT version is set up correctly. What will indicate a correct kit setup is the display of a monitor logo at the label.
Configure a kit by first selecting it as default
C and C++ Compiler -> ''Microsoft Visual C++ Compiler 15.9.xxxx''
Compiler version 15.9.xxxx is a part of Microsoft Visual Studio 2017. If you cannot find this compiler in the drop down box, it is most likely because you are missing the 2017 install. Download the BUILD TOOLS and REDIST PACKAGE from here.
Debugger -> ''C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\cdb.exe''
If you can't find the debugger, it means you are missing the Windows 10 SDK. [[https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/|Download from here]].
QT Version -> ''Qt 5.14.1 MSVC 2017 32bit''
CMake generator (not sure how important this is, but it seems to make the compile run): Ninja

No language defined for the project: Ada GNAT GPS

I've been having this issue where I've installed the GNAT (x86 windows 2017) on my other machine, and I suddenly have these errors, Error: no native compiler found for language 'ada', default runtime and no languages defined for this project. All of this is under the .gpr file of my project. This never happened to me on the other PC.

Starting Gnat Studio with Alire fails

I have had a try at using Gnat Studio with the Alire package manager. Launching Gnat Studio using the 'alr edit' command is causing Gnat Studio to crash. I have had a look at the log file and there are several .dll files causing exceptions. The file entries are like this:
[PROJECTS.EXCEPTIONS] Unexpected exception: raised CONSTRAINT_ERROR : gnatcoll-projects.adb:5729 index check failed _PROJECTS.EXCEPTIONS_ [C:\GNATSTUDIO\bin\gps.libgnatcoll\libgnatcoll.dll] _PROJECTS.EXCEPTIONS_ 0x7ffc78dcecb8 ??? at ???
Gnat Studio opens in an 'inconsistent state' and crashes.
Regards
Mike
I also had problems using alire with GNAT Studio.
GNAT Studio seems to need some environment variables set by alire
to be available at project startup.
I found a GNAT plugin that automatically sets those on project start, but
I had to adapt it to work for alire 1.1.x.
My version is on GitHub at https://github.com/mhatzl/gps_alire.
Close GNAT Studio and copy the python file of the repo inside .gnatstudio/plug-ins, which should be located in your user directory.
After that, GNAT Studio should be able to setup everything needed from alire if you open your .gpr file.
Note: This works for me on Windows 10.

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.

QtGui4.dll entry point not found

I'm trying to write Qt3D application in windows. I'm getting an error when i trying to compile the program and run it. the error's message is : 'The procedure entry point ??4QImage##AEAAV0#$$QAV0##Z could not be found in the dynamic link library QtGui4.dll'.
my compiler is Microsoft Visual C++ 9.0 and Qt version is 4.8.1.
is there any solution for this?
Do you face the problem in both running from the IDE and standalone exe, and both in debug and release mode. IF some of these work, make sure proper QtGui4.dll is copied to the same path where your executable is getting generated.

Resources