Robert McLean
Robert McLean

Reputation: 13

Intel Fortran on MS Visual Studion problem

I have a problem using Intel Fortran with Microsoft Visual Studio Community Edition. I have read a series of posts here on StackOverflow and on Intel forums about this problem but I have not found a solution that works for me.

I get the error message "fatal error RC1015: cannot open include file 'winres.h' " when I try to create a resource file, or design a form within Visual Studio in a Fortran project. No problem with C++ projects. I can do Fortran console projects in VS2022 just fine, it is only gui type projects with the problem.

There is a post on Intel forums from Bond_Andrew 08-02-2018 saying his problem was solved, it was due to the .rc extension being associated with Embarcadero's RADStudio at the time VS was installed. and he gives a link to the solution. But that link just leads to a list of posts that has nothing to do with the problem, I guess because there have been 7 years worth of posts in the mean time.

So I dont really know the solution he referred to, but I assumed that the answer is to correct the .rc extension association. I do have Embarcader RADstudio installed so the solution sounded plausible to me. So I did that, changed the association from bdslauncher (an Embarcadero thing) to VS2022.

This did not solve the problem. So I noticed the phrase "at the time VS was installed".

So I did a fresh install of Visual Studio Community Edition, making certain .rc was not associated with Embarcadero. Then I did a fresh install of Intel fortran (intel-fortran-compiler-025.0.4.19_offline.exe ) and checked the boxes to integrate with VS 2022 and VS 2019.

No difference, still the same error message.

I have contacted VS help, and after a few emails back and forth, which basically told me to install Fortran again, and how to navigate through VS, they have now closed the ticket and said it is a Fortran problem not a Visual Studio problem, and gave me a link to the Intel forums. I posted the problem on Intel forums, got about 150 looks, but no replies.

And I do have winres.h on my machine in several locations so I dont think it is a case of it just cant find it.

So, any suggestions ?

Thank you, Robert

Edit : I have been advised in another post that the correct procedure is to edit my question, so here is some information about the difference between my C++ project config and my Fortran config, relating to WindowsSDK version vs Windows version. C++ config enter image description here

Fortran Config enter image description here

I was also advised not to post screen shot, but to select text and post that, but I am not able to select text from these view. Note the lack of any reference to WindowsSDK in the Fortran project config file. So I am trying to find out why my Fortran projects dont have this, but my C++ projects work fine.

Upvotes: 1

Views: 72

Answers (1)

Michael Ermakov
Michael Ermakov

Reputation: 34

Even I could not reproduce your problem, I would try to give some directions to check the possible ways. I use VS2022 and oneAPI ifort/ifx, however not in a link, and my VS2022/C++ projects use simple resources without links to windows headers.

  1. To check which (resource) file refers to winres.h. Try to delete this include line.

  2. To check if a correct directory with winres.h is mentioned in the Configuration Properties->Resources->General->"Additional Standard Include Path".

  3. To check if MFC framework is installed properly.

  4. To check if the resulting string of include directories does not exceed 512 symbols.

  5. To google deeper "Resource Compiler Fatal Error RC1015".

Useful links: fatal error RC1015

VS 2017: fatal error RC1015: cannot open include file 'winres.h'

https://developercommunity.visualstudio.com/t/vs2017-fatal-error-rc1015-when-attempting-to-add-a/54792

Upvotes: 0

Related Questions