Pelles C forum

C language => Expert questions => Topic started by: John Z on November 29, 2025, 02:45:35 PM

Title: Adding version rc to Library
Post by: John Z on November 29, 2025, 02:45:35 PM
Is it possible to add a version resource to a library?
I get an error when I try to add it to the ResizerZ.lib build.
Building Add_version.res.
*** Error:   "C:\Program Files\PellesC\Files\ResizerZ\Add_version.rc" -Fo"C:\Program Files\PellesC\Files\ResizerZ\output\Add_version.res"
*** Error: The parameter is incorrect. 
Done

I tried with the Pelle Control dialog, default version resource without any changes, also with just a rc script.

Or is there any other way to incorporate a viewable version number in a .lib?

Any help is appreciated!

John Z
Title: Re: Adding version rc to Library
Post by: TimoVJL on November 29, 2025, 04:38:08 PM
https://stackoverflow.com/questions/531502/vc-resources-in-a-static-library#1631078 (https://stackoverflow.com/questions/531502/vc-resources-in-a-static-library#1631078)
Title: Re: Adding version rc to Library
Post by: John Z on November 29, 2025, 06:04:20 PM
Thanks Timo,

Not quite what I was looking for. I was hoping to be able to right click on the .lib file and the select properties which would show a version number like it does with an .exe file.

I think instead I'll just add a function in the lib which will return the version # on request. int or maybe float = Get_Version(); something like that -

John Z


Title: Re: Adding version rc to Library
Post by: TimoVJL on November 29, 2025, 06:35:05 PM
Use unique symbol name for getting version.
Title: Re: Adding version rc to Library
Post by: Vortex on November 29, 2025, 09:35:24 PM
Microsoft's Windows Resource To Object Converter cvtres.exe can convert a .res file to an .obj file.
Title: Re: Adding version rc to Library
Post by: TimoVJL on November 29, 2025, 09:50:09 PM
Wasn't what wanted.
Windows file manager was a basic problem.
Title: Re: Adding version rc to Library
Post by: Vortex on November 30, 2025, 11:44:24 AM
Hi Timo,

Thanks, you are right. John's idea is nice :

QuoteI think instead I'll just add a function in the lib which will return the version # on request. int or maybe float = Get_Version(); something like that

One can even can modify the static library to update the version number, a find and replace binary data utility can do the job.