Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29390 토론

Resource script compilation / dependencies

netphilou31
새로운 기여자 III
4,619 조회수

Hi,

I am using Intel Visual Fortran Composer XE version 2011.12.369 along with VisualStudio 2010 shell.

I have projects that include resources scripts containing particular types of resources (in fact binary files identified with the RT_FILE ID). My problem is that when the files are changed, the resource file (.res) is not updated (i.e. the resource script is not compiled to take into account of the update of the included resources). I am sure that this is working properly with the former compiler COMPAQ Visual Fortran (because I am still using CVF projects including such resources types) and I guess that this shall be working with the full version of VisualStudio but why this is not working with the shell ? Is there any workaround to solve this, should I use an external resource compiler and is Yes how to replace the default resource compiler ?

I have tried to force the resource compiler to be invoked by deleting the res file in a PreBuild command by this does not seems to work.

Any Idea ?

Best regards,

0 포인트
24 응답
netphilou31
새로운 기여자 III
3,860 조회수

Hi,

Some additionnal information,

I have tried using the full version of Visual Studio and, unfortunately, this finally does not work more. However, I have found a workaround which, even if it is not very efficient or elegant, works properly: In the Post-Build section I force the deletion of the .res file. By this way the Build process will always recompile the .rc script file. This leads me to another question : Is there any way to force the compilation of the resources without using this trick ?

0 포인트
andrew_4619
명예로운 기여자 III
3,860 조회수

Try making a new solution and project. It sound to me like the one you have is a bit messed up. It should work fine in the VS2010 shell.

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Hi,

I have tried what you suggested but it does not seems to work more. The first time it was working (which is logical because no res file was already present) but if I remove one of the included resources which will be regenerated during the build using a custom build step, the .rc is not recompiled again to update the res file.

Best regards,

0 포인트
andrew_4619
명예로운 기여자 III
3,860 조회수

So  does the resource compiler invoke when you do a 'rebuild solution'?

Also is the resource.h (the C one not the fortran .fd version) explicitly included in the project? 

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Hi,

Yes, when doing a rebuild, the resource compiler is invoked and yes the resource.h file is included in the project (in the "Header files" folder)

 

0 포인트
andrew_4619
명예로운 기여자 III
3,860 조회수

 If you right click on the rc or h file in the solution exploer winding and check the properties. there is an 'exclude from build option' that might be set? Other than that I'm out of ideas on that one now.....

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Nor the .rc file nor the .h are excluded from the build (they are built when doing a rebuild all).

Thanks.

0 포인트
Steven_L_Intel1
3,860 조회수

I've seen this happen when the file association for .rc files gets changed.

Run regedit.exe and look at HKEY_CLASSES_ROOT\.rc

You should see something similar to this (the VS versions will vary depending on what you have installed.)

capture.png

If it doesn't say text/plain, that may be the problem. In this case I usually suggest deleting the .rc entry from the registry and doing a "repair" on Visual Studio.

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Hi Steve,

Thanks for the reply. I have checked the registry and everything seems to be Ok (same display as your screen capture).

Best regards,

 

0 포인트
Steven_L_Intel1
3,860 조회수

That "Open with devenv.exe" worries me a bit. I suggest you delete the .rc entry and do a repair of Visual Studio - that should fix it.

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

What do you mean by "do a repair of Visual Studio". Do you mean repair from the control pannel / Programs / Uninstall) ? or is there a another way to do it ?

Best regards,

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Steve,

I have several possibilities repairing Visual studio (to  remind you I was using the shell installed with Intel ComposerXE)

  • Microsoft Visual Studio 2010 Service Pack 1
  • Microsoft Visual Studio 2010 Shell (Integrated) - ENU  
  • Microsoft Visual Studio 2010 SP1 files for Intel Visual Fortran

which one should I repair ? (they have all ben installed on the same date). 

Best regards.

0 포인트
Steven_L_Intel1
3,860 조회수

I mean from Control Panel > Programs and Features. Do a Modify on Visual Studio (I would say the Shell) and select Repair when you get to the prompt for that.

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Does not seems to solve the problem. I have tried to uninstall "Microsoft Visual Studio 2010 Shell (Integrated) - ENU", but unfortunately this removed it without any other choice so I had to reinstall from the downloaded isntallation and I had to select "Modify" to be able to reinstall the shell.

0 포인트
Steven_L_Intel1
3,860 조회수

And that didn't fix the problem?

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

No. When deleeting one of the files used in the .rc script, that file is being rebuild but the .rc script is not being recompiled. At the moment the only workaround I have found is to delete the .res file generated during the build in the Post-Buiild section in order to ensure that the .rc file is being systematically rebuild.

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Now If I look at the redistry, I have only this:

 

0 포인트
Steven_L_Intel1
3,860 조회수

Oh - so this is a dependence problem, not a general issue compiling the .rc file. My suggestions for the registry don't apply.

Can you attach a ZIP of a sample project that demonstrates the problem?

0 포인트
netphilou31
새로운 기여자 III
3,860 조회수

Hi Steve,

Please find attached an example to demonstrate the problem. If you remove manually the BIN file located in the Resources folder (after the project has been built once), the file is getting recompiled again using the custom build step but not the resource script ! (at last, that's what is happening on my computer).

0 포인트
netphilou31
새로운 기여자 III
3,738 조회수

Hi Steve,

Is there any update for the above problem ?

Best regards,

Phil.

0 포인트
응답