Boost C++ Libraries: Ticket #5371: The portable binary example fails to compile when the BOOST_ALL_DYN_LINK macro is defined. https://svn.boost.org/trac10/ticket/5371 <p> Dears, </p> <p> The portable binary example demo_portable_archive.cpp fails to compile when the BOOST_ALL_DYN_LINK macro is defined. With boolst 1.45 under windows 7 in Visual Studio 2008 the compiler stops with error C2491 (definition of dllimport function not allowed). </p> <p> Compilation works when I globally define BOOST_ARCHIVE_SOURCE. However I suppose this private macro is not intended to be globally defined in the command line. Furthermore this breaks Visual Studio's autolink feature so that I have to explicitly add boost_serialization-vc90-mt.lib to the linker dependencies. </p> <p> The problem seems to be connected to BOOST_ARCHIVE_OR_WARCHIVE_DECL. How can this issue be fixed so that we can write custom binary archives and use BOOST_ALL_DYN_LINK? </p> <p> To make the example_project compile in you environment you first have to set the library and include directories according to you boost root. (<a class="missing wiki">AdditionalLibraryDirectories</a> <a class="missing wiki">AdditionalIncludeDirectories</a> in the project file.) The exe is put to example_project\debug\output. A file containing the error message is also in example_project. </p> <p> Best regards, Benedikt Huber </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5371 Trac 1.4.3 benedikt.huber@… Fri, 25 Mar 2011 14:02:57 GMT attachment set https://svn.boost.org/trac10/ticket/5371 https://svn.boost.org/trac10/ticket/5371 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">example_project.zip</span> </li> </ul> <p> Project that fails to compile. </p> Ticket anonymous Fri, 25 Mar 2011 14:03:40 GMT component changed; owner set https://svn.boost.org/trac10/ticket/5371#comment:1 https://svn.boost.org/trac10/ticket/5371#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Robert Ramey</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">serialization</span> </li> </ul> Ticket Robert Ramey Thu, 14 Apr 2011 04:06:18 GMT status, type, severity changed; resolution set https://svn.boost.org/trac10/ticket/5371#comment:2 https://svn.boost.org/trac10/ticket/5371#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Not Applicable</span> </li> </ul> <p> demo_portable_archive.cpp is an example. The example as written does work as advertised. </p> <p> If you want to turn it into a "full fledged" archive class like the other "official" ones, you could add in the autolinking macros in a way similar to the way they are used in the other archives. If you want to do this and test it I would consider checking your enhancement into the trunk. But perosnally I'm too busy to deal with it now. </p> <p> Robert Ramey </p> Ticket