Julio Jerez wrote:but for what I can see ther is a lot of editing going on each time I make a new build.
how that worlk?
Editing can be avoided. I thing following changes will do the trick:
In 'newton.h' you have two definitions: NEWTON_MAJOR_VERSION and NEWTON_MINOR_VERSION. They can be used to automatically fill necessary information in resource file.
1. First everything in newton.h after mentioned macros should be surrounded by for example:
- Code: Select all
//********************************************************************
// Newton Game dynamics
// copyright 2000-2004
// By Julio Jerez
// VC: 6.0
// One and only header file.
//********************************************************************
#ifndef NEWTON_H__736495_6495_076__INCLUDED_
#define NEWTON_H__736495_6495_076__INCLUDED_
#define NEWTON_MAJOR_VERSION 2
#define NEWTON_MINOR_VERSION 15
#ifndef NEWTON_VERSION_ONLY
// REST OF THE HEADER
#endif /* NEWTON_VERSION_ONLY */
#endif /* NEWTON_H__736495_6495_076__INCLUDED_ */
2. Now resource file can be modified in this way:
- Code: Select all
#define NEWTON_VERSION_ONLY
#include "Newton.h"
#define STRINGIZE_(value) #value
#define STRINGIZE(value) STRINGIZE_(value)
#define NEWTON_VERSION NEWTON_MAJOR_VERSION, NEWTON_MINOR_VERSION, 0, 0
#define NEWTON_VERSION_STR STRINGIZE(NEWTON_MAJOR_VERSION) "." STRINGIZE(NEWTON_MINOR_VERSION)
#ifdef _WIN64
#define NEWTON_ARCHITECTURE "x64"
#else
#define NEWTON_ARCHITECTURE "x86"
#endif
#ifdef __USE_DOUBLE_PRECISION__
#define NEWTON_PRECISION "Double"
#else
#define NEWTON_PRECISION "Single"
#endif
LANGUAGE 0x00, 0x00
1 VERSIONINFO
FILEVERSION NEWTON_VERSION
PRODUCTVERSION NEWTON_VERSION
FILEFLAGSMASK 0x0000003FL // VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS 0x00000001L // VS_FF_DEBUG
#else
FILEFLAGS 0x00000000L
#endif
FILEOS 0x00040004L // VOS_NT_WINDOWS32
#ifdef _NEWTON_USE_LIB
FILETYPE 0x00000007L // VFT_STATIC_LIB
#else
FILETYPE 0x00000002L // VFT_DLL
#endif
FILESUBTYPE 0x00000000L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4" // U.S. English, Multilingual
BEGIN
VALUE "Comments", "http://newtondynamics.com"
VALUE "FileDescription", "Newton Game Dynamics (Precision: " NEWTON_PRECISION ", Architecture: " NEWTON_ARCHITECTURE ")"
VALUE "FileVersion", NEWTON_VERSION_STR
VALUE "InternalName", "newton"
VALUE "LegalCopyright", "Copyright (C) 2003-2010 Julio Jerez, Alain Suero"
VALUE "OriginalFilename", "newton.dll"
VALUE "ProductName", "Newton Game Dynamics"
VALUE "ProductVersion", NEWTON_VERSION_STR
VALUE "Architecture", NEWTON_ARCHITECTURE
VALUE "Precision", NEWTON_PRECISION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
I had updated version definition, because previous one was damaged, and file info was not displayed by Windows Explorer. Now it works:

Extra values are not show by Windows Explorer so I added information about precision and architecture to description block. Also I fixed are typos.
In that way, you, as usual, keep up to date NEWTON_MAJOR_VERSION, NEWTON_MINOR_VERSION defines. They maybe should be used to to implement NewtonWorldGetVersion() if not already.
Julio Jerez wrote:and how can it be used in static libraries.
There is no way to distinguish static libraries in that manner. The only way I know to work is to use concrete naming scheme. For example {name}-{precission}-{version}-{compiler}-{runtime}-{architecture}.lib which gives following decoration: 'newton-single-2.22-vc90-mt-x64.lib'.
In that way all compiled libraries can be put in a single folder. This is convenient if you use some kind of auto tools to build whole release. Doing that by hand is just more annoying that limitations of static libraries.
Julio Jerez wrote:how do you open this dialog in visual studio? I have never seem that
This screen is from Total Commander listener with
fileinfo plug-in. Some basic information about DLL you can obtain on property