使用boost.filesystem使用时编译错误

本文详细介绍了在使用boost.filesystem库时遇到的VS2008编译错误问题,并提供了针对性的解决方法。通过调整设置将wchar_t视为内置类型,可以有效解决此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用boost.filesystem使用时编译错误

错误(我的是vs2008):

1>main.obj : error LNK2019: 无法解析的外部符号 "private: static class stlp_std::codecvt<unsigned short,char,int> const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(void)" (),该符号在函数 "public: static class stlp_std::codecvt<unsigned short,char,int> const & __cdecl boost::filesystem3::path::codecvt(void)" () 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "void __cdecl boost::filesystem3::path_traits::convert(char const *,char const *,class stlp_std::basic_string<unsigned short,class stlp_std::char_traits<unsigned short>,class stlp_std::allocator<unsigned short> > &,class stlp_std::codecvt<unsigned short,char,int> const &)" (),该符号在函数 "void __cdecl boost::filesystem3::path_traits::dispatch<class stlp_std::basic_string<unsigned short,class stlp_std::char_traits<unsigned short>,class stlp_std::allocator<unsigned short> > >(class stlp_std::basic_string<char,class stlp_std::char_traits<char>,class stlp_std::allocator<char> > const &,class stlp_std::basic_string<unsigned short,class stlp_std::char_traits<unsigned short>,class stlp_std::allocator<unsigned short> > &,class stlp_std::codecvt<unsigned short,char,int> const &)" () 中被引用

解决:

这是vs没有默认wchar_t为内置的原因, 选择 项目 -> c/c++ -> 语言 -> 将wchar_t视为内置类型(是)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值