const ints as Message IDs = Recompile Everything
<p>I'm hoping for confirmation of what I just told someone.
We have a large software project that is divided out into several libraries (.so). The message definitions are all in one library with a set of .h files for the declarations. The message ids are in the .h as const int (see below). One uses the id to subscribe/publish the message.</p>

<p>They had to go and renumber the message ids. They were hoping just to drop in the new library.</p>

<p>I said that they have to recompile all the source that uses the library.</p>

<p>Const objects are internal linkage by default, so the external code that uses the id is <em>not</em> linked to an object changed by the library, rather it is a simple integer that is now out of sync with the library.</p>

<p>I feel very sure that I am right about this.... Or am I all wet?</p>

<pre><code>namespace AppsMessages
{

const DataClassID_t CommandReqId(120097);

class CommandRequestMessage { ... };
}
</code></pre>
