Opened 12 years ago
Closed 12 years ago
#4902 closed Bugs (fixed)
strange auto_link behaviour with --layout=system & defined BOOST_AUTO_LINK_NOMANGLE under vc9.0
| Reported by: | Owned by: | Beman Dawes | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | filesystem |
| Version: | Boost 1.44.0 | Severity: | Problem |
| Keywords: | Cc: |
Description
Env: Visual Studio 9.0.30729.1 SP Boost built with --layout=system
in user code:
#define BOOST_AUTO_LINK_NOMANGLE 1 #define BOOST_LIB_DIAGNOSTIC #include <boost/filesystem.hpp>
in auto_link.hpp I made a little change in pragma message to clarify what happens:
#ifdef BOOST_AUTO_LINK_TAGGED
# pragma commentcomment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file(1): " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
# endif
#elif defined(BOOST_AUTO_LINK_NOMANGLE)
# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file(2): " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# endif
#else
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file(3): " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
# endif
#endif
then I get the compiler output:
1>Linking to lib file(2): boost_filesystem.lib 1>Linking to lib file(3): libboost_system-vc90-mt-gd-1_44.lib
Looks like the "else" preprocessor section is executed.
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
| Component: | None → filesystem |
|---|---|
| Owner: | set to |
comment:4 by , 12 years ago
This is my mistake, BOOST_AUTO_LINK_NOMANGLE should not get #undef'ed by auto_link.hpp. Now fixed in Trunk.
John.
comment:5 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

I see that auto_link.hpp is included 2 or more times, and BOOST_AUTO_LINK_NOMANGLE is undefined after first call. I wonder for what reason? Is it the possible solution to comment out #undef BOOST_AUTO_LINK_NOMANGLE ?