Wednesday, June 18, 2008

VS2005 and wchar_t

While upgrading a VS2003 solution to VS2005, I received the following error:

Error 29 error LNK2028: unresolved token (0A001D22) "public: void __thiscall osgText::TextBase::setText(unsigned short const *)" (?setText@TextBase@osgText@@$$FQAEXPBG@Z) referenced in function "private: class osg::Node * __thiscall XXX::YY::ZZZ::FFF::WWWW(class XXX::YY::ZZZ::FFF::CCC &,class osg::Vec4f const &)" (?KKKKK@TTTTT@CCCCC@YY@XXX@@$$FAAEPAVNode@osg@@AAVGGGGG@234@ABVVec4f@6@@Z) RRRRRR.obj

My first thought was to make sure I had the correct version of the OSG libraries. They were OK, so then I googled some keywords of the error message and came across something interesting. VS has an option in Tools->Options that is "Treat wchar_t as built in type". My default value was false, so I set it to "Yes" and rebuilt the libraries. It worked!

No comments: