Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I do not think this is possible without modifying the library itself. I guess it is about a static library (inside a dll, the overridden new/delete will be pointed by the functions inside the dll.)</p> <p>You can remove an obj file from a static library by using the command (Visual command prompt):</p> <pre><code> LIB /REMOVE:obj_to_remove /OUT:removed.lib input.lib </code></pre> <p>To find out what obj to remove, first run:</p> <pre><code> DUMPBIN /ARCHIVEMEMBERS input.lib </code></pre> <p>You will see lines such as </p> <pre><code> Archive member name at 14286: /0 compilation.dir\objfile1.obj </code></pre> <p><code>14286</code> 'identifies' the obj file. To see where each symbol is, run:</p> <pre><code> DUMPBIN /LINKERMEMBER:1 input.lib &gt; members.txt </code></pre> <p>and look for the new/delete. <code>members.txt</code> will contains the mangled names of each symbols and an identifier of the obj in which this symbol is. For instance</p> <pre><code> 14286 ?_Rank@?$_Arithmetic_traits@C@std@@2HB </code></pre> <p>The <code>14286</code> is telling you the obj 'identifier' in which the symbol lies. If you have trouble finding new/delete, you can run:</p> <pre><code> DUMPBIN /SYMBOLS input.lib &gt; sym.txt </code></pre> <p>which will flush into <code>sym.txt</code> the mangled and unmangled names for each symbol. </p> <p>At the end, remove the obj file with the <code>LIB</code> command above by replacing <code>obj_to_remove</code> by <code>compilation.dir\objfile1.obj</code> in our example, and link against <code>removed.lib</code>. </p> <p>Now, if you are not lucky, other symbols you need may be in the same object file as the new/delete. In that case, you can "hack" the lib using something like <a href="https://stackoverflow.com/questions/678254/c-function-conflict/678350#678350" title="this">this</a> (say renaming <code>new</code> to <code>dew</code> and <code>delete</code> to <code>nelete</code>.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload