Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29236 Discussões

Classic Fortran Windows Project in VS2019 won't recognize resource file

CHobbs1
Novo colaborador I
3.958 Visualizações

All;

I have set up a classic fortran project in VS2019 after installing the one API HPC software.  The test hello, world project compiles and runs for a command line project, but setting up a classic fortran windows project in VS2019 only compiles the fortran code and runs to show a window with the right graphics in it.  There is no menu on the window because the resource file (*.rc) does not compile and link.  

The VS2019 shows the icon of the rc file as blank in the Resource Files folder.  So, I don't think it recognizes it.  Any idea why that might be?

These files work on the command line.  This is a VS2019/1 API - Classic Fortran question.

Any thoughts appreciated.  Thank you.

0 Kudos
1 Solução
Steve_Lionel
Colaborador honorário III
3.889 Visualizações

Click on the Windows Start button and type regedit - when the Registry Editor shows up in the list, click to open it.

Expand HKEY_CLASSES_ROOT and click on .rc (you'll have to scroll down a lot.) Is the Content Type text/plain? I have seen issues where installing other tools changes this to something else, and VS won't recognize it.

What usually fixes this is to delete the .rc entry (click on .rc and press Delete), then run a "repair" on Visual Studio.

 
 

Ver solução na publicação original

10 Respostas
Steve_Lionel
Colaborador honorário III
3.946 Visualizações

If you double-click on the .rc file, does it open the resource editor? 

 

 
CHobbs1
Novo colaborador I
3.940 Visualizações

Hey, Steve;

If I double click on it I get an error that says 'cannot find the winparam.h file' but then it allows me to edit the code.  This resource file was created with the Winteracter library.  That file is in the path for include file stuff.

CHobbs1
Novo colaborador I
3.937 Visualizações

Whoops, if I do the custom build option and put rc -ic:\path to rc file on the input and put same directory in the output section of the custom build with a *.res on the file, then this all works.

Steve_Lionel
Colaborador honorário III
3.913 Visualizações

You shouldn't have to do that. 

The winparam.h thing is an issue I have seen before, and I never did figure out the cause. For some odd reason, in some installs, the resource compiler (rc) isn't seeing the paths to the Windows SDK include files. When I have had this problem, not for a while now, I edited the file to include the full path to winparam.h.

 

CHobbs1
Novo colaborador I
3.898 Visualizações

Steve, the problem here I think is that VS2019 is not even trying to evoke rc.exe to compile the resource file because it thinks it is another type of file.  The installation of this Winteracter library should have happened before I installed VS2019 and Intel Fortran.  So, even though the computer thinks VS2019 is the default program for *.rc files, clicking on the *.rc file in the solution explorer of VS2019 shows in properties that it thinks the file type is Winteracter resource.

Any ideas on how I might convince VS2019 to invoke the rc program to compile the *.rc file without a custom build?  Short of uninstalling VS2019 and fortran and reinstalling them, I'm at a loss.  

As always, your advice is appreciated.

Steve_Lionel
Colaborador honorário III
3.890 Visualizações

Click on the Windows Start button and type regedit - when the Registry Editor shows up in the list, click to open it.

Expand HKEY_CLASSES_ROOT and click on .rc (you'll have to scroll down a lot.) Is the Content Type text/plain? I have seen issues where installing other tools changes this to something else, and VS won't recognize it.

What usually fixes this is to delete the .rc entry (click on .rc and press Delete), then run a "repair" on Visual Studio.

 
 
CHobbs1
Novo colaborador I
3.883 Visualizações

I think you are onto something.  It refuses to delete, but that may be a privileges thing.  Attached is the pic showing the Winteracter.resource thing.  Pretty sure that is the route of my problem coming from me improperly installing the library.

 

I believe this is the solution and I just need to make it happen.  Thank you, Steve.

Steve_Lionel
Colaborador honorário III
3.873 Visualizações

Yes, that is very likely the problem. Start over with the search, and this time when regedit comes up, select "Run as administrator". Now you'll be able to delete the entry and can do the "repair" of the VS install.

 
CHobbs1
Novo colaborador I
3.868 Visualizações

That did it, Steve!  I am where I need to be.  Thank you!

DavidWhite
Contribuidor valorado II
995 Visualizações

Hi Steve,

 

I have a similar problem in VS 2022 now.  I have deleted the .rc entry and repaired VS, but the Content Type is still text/plain (although the reference to Winteracter has been removed).  

 

I created a new resource file in VS, which appeared to display properly, but now reports the "winres.h" not found error and won't compile.

 

Any other ideas?

 

And then it starts working!  Now you see it, now you don't

 

Thanks,

 

David

Responder