How add "version.txt" Version File by Command Line or by resources.res using dmd.exe

ShadoLight ettienne.gilbert at gmail.com
Tue Dec 10 09:48:11 UTC 2019


On Tuesday, 10 December 2019 at 07:23:00 UTC, rumbu wrote:
> On Sunday, 8 December 2019 at 20:50:05 UTC, Marcone wrote:
>> I want to add version to my program.
>> I have configurated my version file "version.txt",  but I dont 
>> know how link this file to my program. If Need spec file, 
>> please send the exemple code of spec. Or is is possible add 
>> version file by dmd command line or resources. Thank you.
>
> Your version.txt file is python specific, it will not work in D.
>
> You have 2 options:
> - create a .res file in Visual Studio and edit it by adding a 
> VERSIONINFO resource.
> - create a .rc file in any text editor adding a VERSIONINFO 
> resource; compile it to .res using rc yourfile.rc
>
> Pass the .res file to the dmd compiler in the command line.

To add to Rumbo's comment: to compile a *.rc to *.res file you 
will need a resource compiler.

Digital Mars's C/C++ tools [1] include one, but I suspect only 
for x86.

But, if you are on Windows, all of the recent Windows SDKs bundle 
the resource compiler as well - in both x86 and x64 versions.

On my PC I have rc.exe as part of SDK v7.1...
c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\RC.Exe
c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64\RC.Exe

..as well as part of SDK v8.1:
c:\Program Files (x86)\Windows Kits\8.1\bin\x64\rc.exe
c:\Program Files (x86)\Windows Kits\8.1\bin\x86\rc.exe

I don't have SDK 10 installed, but that will probably also 
contain it.

You should be able to get the individual SDKs from [2] or as part 
of a Visual Studio download.

[1] http://ftp.digitalmars.com/bup.zip
[2] 
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive


More information about the Digitalmars-d-learn mailing list