[config] Possible bug in config/platform/win32.hpp

In config/platform/win32.hpp I see: #if !defined(__GNUC__) && !defined(BOOST_HAS_DECLSPEC) # define BOOST_HAS_DECLSPEC #endif This tells me that __declspec can be possibly used for all Windows compilers except for gcc. I believe, however, that for Comeau-Win32 __declspec can also not be used. When trying to build Boost libraries for Comeau with the VC7.1 backend, the compiler gives this error in the date/time library when trying to compile greg_month.cpp with BOOST_ALL_DYN_LINK defined: ""H:\Utilities\BoostLibraries\boost_1_32_0\boost/date_time/gregorian/greg_month.h pp", line 55: error #70: incomplete type is not allowed class BOOST_DATE_TIME_DECL greg_month : public greg_month_rep {" ^ I could be wrong but this seems to me that the compiler is objecting to BOOST_DATE_TIME_DECL, which becomes __declspec(dllexport) because BOOST_HAS_DECLSPEC is defined for the Comeau compiler. Needless to say many other errors along thr same lines occur in the build for other libraries which use __declspec(dllexport).

Edward Diener wrote:
In config/platform/win32.hpp I see:
#if !defined(__GNUC__) && !defined(BOOST_HAS_DECLSPEC) # define BOOST_HAS_DECLSPEC #endif
This tells me that __declspec can be possibly used for all Windows compilers except for gcc. I believe, however, that for Comeau-Win32 __declspec can also not be used.
When trying to build Boost libraries for Comeau with the VC7.1 backend, the compiler gives this error in the date/time library when trying to compile greg_month.cpp with BOOST_ALL_DYN_LINK defined:
como can't build DLLs, so changing the definition of BOOST_HAS_DECLSPEC in the above file won't help. Jonathan

I could be wrong but this seems to me that the compiler is objecting to BOOST_DATE_TIME_DECL, which becomes __declspec(dllexport) because BOOST_HAS_DECLSPEC is defined for the Comeau compiler.
Needless to say many other errors along thr same lines occur in the build for other libraries which use __declspec(dllexport).
Technically correct, however since you can't build dll's anyway with commeau, the change is pointless. I believe that commeau computing hope to support dll's in a future release, and will very likely support __declspec(dllexport) when they do so. John.

John Maddock wrote:
I could be wrong but this seems to me that the compiler is objecting to BOOST_DATE_TIME_DECL, which becomes __declspec(dllexport) because BOOST_HAS_DECLSPEC is defined for the Comeau compiler.
Needless to say many other errors along thr same lines occur in the build for other libraries which use __declspec(dllexport).
Technically correct, however since you can't build dll's anyway with commeau, the change is pointless.
I assume that one can still build static libraries for Comeau on Win32. In that case is it possible that the build process for Comeau in Win32 can be altered to only build the static library versions of the respective libraries ?
I believe that commeau computing hope to support dll's in a future release, and will very likely support __declspec(dllexport) when they do so.
But one can still define BOOST_ALL_DYN_LINK or BOOST_XXX_DYN_LINK, even erroneously, when building for Comeau, and this will cause compiler errors. Perhaps it is not Boost's responsibility for a user's error in defining BOOST_ALL_DYN_LINK or BOOST_XXX_DYN_LINK but I have discovered, when building libraries for Comeau on Win32 in Boost 1.32, two libraries which define BOOST_ALL_DYN_LINK for the dll versions of their libraries, date_time and program_options. So what happens is that I build Comeau for Win32 and a slew of errors comes out when building the date_time and program_options libraries. I think this needs to be derailed somehow.

Edward Diener wrote:
John Maddock wrote:
So what happens is that I build Comeau for Win32 and a slew of errors comes out when building the date_time and program_options libraries. I think this needs to be derailed somehow.
What I meant to say here is that the build process for Comeau, as it is now with no support for building dlls, should only build the static library versions of the libraries and not the dll versions of the librtaries. I do not know enough of the Boost build process to know if this can be effected or not. I just found it disconcerting that the Boost build process attempts to build the dll versions of the libraries, and since there is no support for this in Comeau, and since BOOST_ALL_DYN_LINK is defined for the dll versions of two libraries, the end-user sees many compiler errors in the build process. In my own copy of config/compiler/comeau.hpp I added: #if defined(BOOST_ALL_DYN_LINK) #undef BOOST_ALL_DYN_LINK #endif to the top of the file just after the: #include "boost/config/compiler/common_edg.hpp" in order to eliminate the compiler errors. Of course linker errors still occur when attempting to build dlls, but this is more acceptable to me.
participants (3)
-
Edward Diener
-
John Maddock
-
Jonathan Turkanis