I have just installed VS2022 and Intel OneAPI Fortran. I have opened VS and added my source code files to a project. However, I can see no way to compile or build the executable. Any suggestions? I have been through all the help files, but they seem to bare little relation to what I have on the screen.
You should be able to see the debug tab on the top of Visual Studio when it is fully open.
If need be open a file for editing and the may fix your problem.
What version of the Fortran compiler are you using? VS2022 support begins with the oneAPI 2022.1 HPC Toolkit for Windows release. The ifort version in that toolkit is 2021.5.0.
My guess is there is a mistake in the install.
If you have time and I would remove VS and Fortran.
I would install VS 2019 and 2022 and then install Fortran, you need the base kit and the HPC. When you install VS make sure you install the C component on the tabs, I usually grab the data science one as well.
It really is quite simple if you get it right, but it is easy to get wrong.
If in doubt select all the VS buttons on install.
These version numbers are confusing!
VS2022 is Microsoft Visual Studio 2022.
Intel released oneAPI 2022.1. Those are toolkits like Base Toolkit and HPC Toolkit. This is the first release that supports VS2022.
Some of the components that make up the oneAPI 2022.1 toolkits have different versioning. For example, ifort is version 2021.5.0. ifx is version 2022.0.0. The components are using Sematic Versioning. This article may help explain the version changes.
Go to the Windows "Apps" settings page, select the Intel HPC Toolkit 2022, Modify. When the installer opens, select Modify. Continue and then check the box for VS2022. Let that complete.
Now repeat the process, except this time select Repair from the Toolkit installer.
Fortran should be now visible in VS2022. If you open a solution and it says a Fortran project is incompatible., right click on it and select Reload.
In addition to the Base Toolkit, can someone please clarify whether the full HPC Toolkit is required, or just the components of interest?
I downloaded the standalone Fortran compiler components yesterday (w_fortran-compiler_p_2022.0.0.77_offline.exe); ie. the Classic Compiler.
Is that all I need from the HPC Toolkit for Fortran programming?
Or do I require the full package?
From the HPC Toolkit, all you need is the Classic Fortran compiler. If you want MKL, that's in the Base Toolkit.
It used to be that debugging support was in the Base Toolkit, but I think that was corrected.
Thank you all for your helpful comments. I have uninstalled everything and started again. Next I installed Microsoft Visual Studio Community 2022 (64-bit) Version 17.0.4. I installed the Intel® oneAPI Base Toolkit for Windows* (64 bit) and the Intel® oneAPI HPC Toolkit for Windows. FORTAN is now supported. I have started a new solution and added all my source code files. It all looks good until I click the build tag. All that happens then is that I see the output message
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
But I cant find and executable or any object files. When I click the start button I get the message "The system cannot find the file specified". I last used FORTRAN using Microsoft Visual FORTRAN about five years ago, so I am a bit in the dark about how to proceed. Am I missing something?
I have now discovered how to add source code files to the project. I had assumed that if they were in the editor window, they were part of the project. Build now works, although there are errors that I made nee to sort out. 'use dflib' may be one of them. I will investigate.
I am using IFQWIN and some other libraies that were associated with my previous version of FORTRAN. I suspect that I may need more up to date libraries. these are the build errors:
Dialog.obj : error LNK2019: unresolved external symbol _settextcolorrgb referenced in function DIALOG Dialog.obj : error LNK2019: unresolved external symbol _f_setfont referenced in function DIALOG Graset.obj : error LNK2001: unresolved external symbol _f_setfont Dialog.obj : error LNK2019: unresolved external symbol _settextcursor referenced in function DIALOG Graset.obj : error LNK2019: unresolved external symbol _remappalette referenced in function GRASET Graset.obj : error LNK2019: unresolved external symbol _setcolor referenced in function GRASET Graset.obj : error LNK2019: unresolved external symbol _setbkcolor referenced in function GRASET Graset.obj : error LNK2019: unresolved external symbol _floodfillrgb referenced in function GRASET Graset.obj : error LNK2019: unresolved external symbol _initializefonts referenced in function GRASET Graset.obj : error LNK2019: unresolved external symbol _f_moveto referenced in function GRASET Graset.obj : error LNK2019: unresolved external symbol _f_outgtext referenced in function GRASET MSVCRTD.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
Your project is setting the wrong default calling convention I believe. I think it will be (If I remember correctly ) the /iface option. Remove that and see what you get.
Yes that is what I meant when I said "if this is a QuickWin project it will also need the correct project type in the settings", maybe I should have been more specific. If you make a new project and specify it is Quickwin it sets the correct run time etc for you automatically