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

Can /Version be used from within CVF 6.6?

mjfinney
Beginner
574 Views
I am looking for a way to print a version number to program output without changing Fortran code.

I have looked into /Version; is this version info available to Fortran code in a console app or can it be printed to output?

VERSION major [.minor]
This statement tells LINK to put a number in the header of the executable file or DLL.

I have looked into the Version Information Editor for VC++ but can't find out if this is available to a Fortran console project as well.

Thanks in advance.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
574 Views
This is usually done in a "version resource", though I suppose you can do it with the linker switch. The version info is in the image and would require code to pull out and display.
0 Kudos
mjfinney
Beginner
574 Views
I have not figured out how to add a version resource to a Fortran console app. I can create the resource and compile it but the CVF help file doesn't indicate how to add this to my project.

On the linker option side; if adding a version number using "/version:1.1" writes the version info to the header or exe image, is there a Fortran function to return the value?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
574 Views
You should just add the .rc file to the project as any other file. Storingthe version there is preferred to using /version linker switch (as you can retrieve it e.g. from File->Properties->Version from Explorer in this way).
You can find the sample Fortran source for version retrieval here. (Additional hint: use GetModuleFileName(NULL,...) to get filename of "yourself").
Jugoslav
0 Kudos
Reply