Opened 12 years ago
Closed 12 years ago
#5371 closed Feature Requests (wontfix)
The portable binary example fails to compile when the BOOST_ALL_DYN_LINK macro is defined.
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost 1.45.0 | Severity: | Not Applicable |
Keywords: | Cc: |
Description
Dears,
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).
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.
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?
To make the example_project compile in you environment you first have to set the library and include directories according to you boost root. (AdditionalLibraryDirectories AdditionalIncludeDirectories in the project file.) The exe is put to example_project\debug\output. A file containing the error message is also in example_project.
Best regards, Benedikt Huber
Attachments (1)
Change History (3)
by , 12 years ago
Attachment: | example_project.zip added |
---|
comment:1 by , 12 years ago
Component: | None → serialization |
---|---|
Owner: | set to |
comment:2 by , 12 years ago
Resolution: | → wontfix |
---|---|
Severity: | Problem → Not Applicable |
Status: | new → closed |
Type: | Bugs → Feature Requests |
demo_portable_archive.cpp is an example. The example as written does work as advertised.
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.
Robert Ramey
Project that fails to compile.