|
Boost Users : |
Subject: Re: [Boost-users] Link errors with MSVC 9 application using Boost date_time on DEBUG build
From: Tom Aylesworth (taylesworth_at_[hidden])
Date: 2009-03-13 18:39:18
Thanks for the fast response, Steven. However, if the problem was in the way my test application or the library was being built, my program should fail the same way in the RELEASE configuration.
With a little more testing, I was able to build the DEBUG configuration if I set the Optimization flag for my test application to O2. In this case, it was still building against the debug version of the boost library (libboost_date_time-vc90-mt-sgdp-1_38.lib) and yet it linked and ran correctly.
I suspect this may be related to the bug you mention in this note:
http://www.nabble.com/Re:-can't-build-threads-on-msvc-7.1-p21504140.html
But even if it is, I don't know how to work around that in my case. Any ideas?
Thanks again,
Tom
-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Steven Watanabe
Sent: Friday, March 13, 2009 17:10
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Link errors with MSVC 9 application using Boost date_time on DEBUG build
AMDG
Tom Aylesworth wrote:
> I have a very simple app that I'm trying to link with the Boost date_time library. It links and runs fine with I build against the RELEASE configuration. But I get the following link errors when when I use the DEBUG configuration:
>
> 2>TimeUtil.obj : error LNK2019: unresolved external symbol "public: char const * __cdecl boost::gregorian::greg_month::as_long_string(void)const " (?as_long_string_at_greg_month_at_gregorian@boost@@QBAPBDXZ) referenced in function "public: static class stlpd_std::basic_ostream<wchar_t,class stlpd_std::char_traits<wchar_t> > & __cdecl boost::date_time::month_formatter<class boost::gregorian::greg_month,class boost::date_time::iso_extended_format<wchar_t>,wchar_t>::format_month(class boost::gregorian::greg_month const &,class stlpd_std::basic_ostream<wchar_t,class stlpd_std::char_traits<wchar_t> > &)" (?format_month@?$month_formatter_at_Vgreg_month_at_gregorian@boost@@V?$iso_extended_format@_W_at_date_time_at_3@_W_at_date_time_at_boost@@SAAAV?$basic_ostream@_WV?$char_traits@_W_at_stlpd_std@@@stlpd_std@@ABVgreg_month_at_gregorian@3_at_AAV45@@Z)
>
> 2>TimeUtil.obj : error LNK2019: unresolved external symbol "public: char const * __cdecl boost::gregorian::greg_month::as_short_string(void)const " (?as_short_string_at_greg_month_at_gregorian@boost@@QBAPBDXZ) referenced in function "public: static class stlpd_std::basic_ostream<wchar_t,class stlpd_std::char_traits<wchar_t> > & __cdecl boost::date_time::month_formatter<class boost::gregorian::greg_month,class boost::date_time::iso_extended_format<wchar_t>,wchar_t>::format_month(class boost::gregorian::greg_month const &,class stlpd_std::basic_ostream<wchar_t,class stlpd_std::char_traits<wchar_t> > &)" (?format_month@?$month_formatter_at_Vgreg_month_at_gregorian@boost@@V?$iso_extended_format@_W_at_date_time_at_3@_W_at_date_time_at_boost@@SAAAV?$basic_ostream@_WV?$char_traits@_W_at_stlpd_std@@@stlpd_std@@ABVgreg_month_at_gregorian@3_at_AAV45@@Z)
>
> It is linking against "libboost_date_time-vc90-mt-sgdp-1_38.lib". Using undname, I can see that the library is using the __thiscall convention instead of __cdecl. Is this a problem in my configuration for building the Boost date_time library, or a problem in my app's build configuration?
>
I believe that __thiscall is the default for member functions.
You need to either change your app's build configuration to
use the default or force the date_time library to be built with
__cdecl.
In Christ,
Steven Watanabe
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net