- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page