Boost.Locale例子确实在VS2010不运行 [英] Boost.Locale Examples doesn't runs in VS2010
问题描述
我一直在努力学习 Boost.Locale
模块。考虑这个例子。在code被成功编译,但是当我尝试运行它,它给人的误差
I have been trying to learn Boost.Locale
Module. Consider this example. The code gets successfully compiled but when I try to run it, it gives the error
未处理的异常:微软C ++异常:的std :: bad_cast内存位置0x00a6fa48 ..
我重视该方案还的堆栈跟踪。在这里,它是:
I have attached the stack-trace of the program also. Here it is:
KernelBase.dll!74d34b32()
[Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
KernelBase.dll!74d34b32()
> msvcr100d.dll!_nh_malloc_dbg(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine) Line 302 + 0x1d bytes C++
msvcr100d.dll!malloc(unsigned int nSize) Line 56 + 0x15 bytes C++
LearningCPP.exe!std::use_facet<boost::locale::converter<char> >(const std::locale & _Loc) Line 526 C++
LearningCPP.exe!boost::locale::to_upper<char>(const char * str, const std::locale & loc) Line 225 + 0x9 bytes C++
LearningCPP.exe!main() Line 170 + 0xc4 bytes C++
LearningCPP.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
LearningCPP.exe!mainCRTStartup() Line 371 C
kernel32.dll!75268543()
ntdll.dll!776bac69()
ntdll.dll!776bac3c()
的确在使用时
?如果是这样,我怎么解决这个问题? Boost.Locale
任何人遇到这个问题的Visual Studio 2010
Did anyone faced this issue when using Boost.Locale
in Visual Studio 2010
? If so, how do I resolve this issue?
PS:我用选项采用UNI code字符集
在字符集
Visual Studio中的选项。我相信库正确链接了。
PS: I have used option Use Unicode Character Set
under the Character Set
option of Visual Studio. I believe the libraries are correctly linked too.
推荐答案
有关其他人谁可能会面临同样的问题,我找到了解决办法。在这个一>例子跑了 calendar.cpp
, collate.cpp
和`conversions.cpp从这个的链接。
For others who may face the same issue, I found the solution. The program still faced error in this example ran for calendar.cpp
, collate.cpp
and `conversions.cpp from this link.
解决的办法是添加 BOOST_ALL_DYN_LINK
在preprocessor在配置属性\\ C / C ++ \\ preprocessor
。该方案是能够事后运行。
The solution was to add BOOST_ALL_DYN_LINK
in preprocessor under Configuration Properties \ C/C++ \ Preprocessor
. The program was able to run afterwards.
PS:在链接我已经加 boost_locale-VC100-MT-GD-1_55.lib
这篇关于Boost.Locale例子确实在VS2010不运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!