Resource script compilation / dependencies

Resource script compilation / dependencies

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,

publicaciones de 25 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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 ?

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.

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,

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? 

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)

 

 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.....

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

Thanks.

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.)

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.

Adjuntos: 

AdjuntoTamaño
Descargar capture.png12.38 KB
Steve - Intel Developer Support

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,

 

Adjuntos: 

AdjuntoTamaño
Descargar capture.png17.97 KB

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.

Steve - Intel Developer Support

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,

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.

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.

Steve - Intel Developer Support

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.

And that didn't fix the problem?

Steve - Intel Developer Support

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.

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

 

Adjuntos: 

AdjuntoTamaño
Descargar capture2.png29.83 KB

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?

Steve - Intel Developer Support

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).

Adjuntos: 

AdjuntoTamaño
Descargar test-rc-dependencies.zip200.4 KB

Hi Steve,

Is there any update for the above problem ?

Best regards,

Phil.

Sorry for not getting back to you on this before.

I am missing the .vbs file used in the pre-build step. But in general you probably want to use a Custom Build Step on CopyrightDate.h (I think) that specifies inputs and outputs for the .BIN file rather than a pre-build step, as the latter doesn't factor in to dependency analysis.

Steve - Intel Developer Support

Thanks Steve,

Sorry for missing to include the vbs script. This script does nothing related to the BIN file. It simply creates/updates the CopyRightDate.h file with the value of the current year. The CopyRightDate.h is included in the resources script in order to have the correct LegalCopyright field of the VERSION_INFO bloc. The CopyRightDate.h is not included in the project because it is automatically generated if it does not exist. For this reason it is created/updated using a Pre-Build step but if you think that it would be better to use a custom build for it I will have to add it in the project. You can try with the attached file (which must be placed in the same directory as the resource script) and remove the pre-build step of the project to see if you can reproduce the problem.

Best regards,

Phil.

 

Adjuntos: 

AdjuntoTamaño
Descargar copyrightdate.h43 bytes

Dear Steve,

Sorry again, because I did not remember that the CopyRightDate.h was already included in the project. So, if you remove the Pre-Build commands, this should produce the same behavior, i.e. removing the .BIN file after a successful build is correctly identified when the next build is tried, and the .BIN file is being created again but the resource script is not being recompiled as it should be.

Best regards,

Phil.

Hi Steve,

No news about the problem ?

Best regards,

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya