<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Microsoft DLL export and C++ templates</title>
	<link>https://codesynthesis.com/~boris/blog//2010/01/18/dll-export-cxx-templates/</link>
	<description>Boris Kolpackov's blog about software</description>
	<pubDate>Sun, 05 Apr 2026 17:36:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Maxim Yegorushkin</title>
		<link>https://codesynthesis.com/~boris/blog//2010/01/18/dll-export-cxx-templates/#comment-1308</link>
		<author>Maxim Yegorushkin</author>
		<pubDate>Thu, 21 Jan 2010 04:45:47 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2010/01/18/dll-export-cxx-templates/#comment-1308</guid>
		<description>Nice post.

However, Microsoft toolchain is lacking love and totally archaic (sorry windows developers).

gcc employs a much more interesting solution: http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.html</description>
		<content:encoded><![CDATA[<p>Nice post.</p>
<p>However, Microsoft toolchain is lacking love and totally archaic (sorry windows developers).</p>
<p>gcc employs a much more interesting solution: <a href="http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.html" rel="nofollow">http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Kolpackov</title>
		<link>https://codesynthesis.com/~boris/blog//2010/01/18/dll-export-cxx-templates/#comment-1302</link>
		<author>Boris Kolpackov</author>
		<pubDate>Tue, 19 Jan 2010 12:22:27 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2010/01/18/dll-export-cxx-templates/#comment-1302</guid>
		<description>Ian,

Interesting, I didn't know about this option. I tried to add it to the test case and it turned the duplicate symbol errors into warnings plus issued this one:

warning LNK4088: image being generated due to /FORCE option; image may not run

While I think the image will run fine in this particular case (the two DLLs will simply use their own instantiations of the functions), this may no be the case in other cases (e.g., if a template has static data members; in this case each DLL will end up with its own version).

The other problem with this approach is that it will also mask other, unrelated, duplicate symbol errors. The user can always read through the list of warnings to make sure nothing suspicious is there but that can quickly become too much since this will have to be done after every change to the code. 

However, this seems like the only viable work around for the case of two independent DLLs that I described above.

Thanks for the information!
Boris</description>
		<content:encoded><![CDATA[<p>Ian,</p>
<p>Interesting, I didn&#8217;t know about this option. I tried to add it to the test case and it turned the duplicate symbol errors into warnings plus issued this one:</p>
<p>warning LNK4088: image being generated due to /FORCE option; image may not run</p>
<p>While I think the image will run fine in this particular case (the two DLLs will simply use their own instantiations of the functions), this may no be the case in other cases (e.g., if a template has static data members; in this case each DLL will end up with its own version).</p>
<p>The other problem with this approach is that it will also mask other, unrelated, duplicate symbol errors. The user can always read through the list of warnings to make sure nothing suspicious is there but that can quickly become too much since this will have to be done after every change to the code. </p>
<p>However, this seems like the only viable work around for the case of two independent DLLs that I described above.</p>
<p>Thanks for the information!<br />
Boris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>https://codesynthesis.com/~boris/blog//2010/01/18/dll-export-cxx-templates/#comment-1299</link>
		<author>Ian</author>
		<pubDate>Mon, 18 Jan 2010 22:12:30 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2010/01/18/dll-export-cxx-templates/#comment-1299</guid>
		<description>Can this issue be resolved instead by using /FORCE:MULTIPLE as a linker option? We had a similar sounding problem with a library and this was the solution suggested.</description>
		<content:encoded><![CDATA[<p>Can this issue be resolved instead by using /FORCE:MULTIPLE as a linker option? We had a similar sounding problem with a library and this was the solution suggested.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
