Afternoon all,
I've somehow managed to break my program such that it will no longer compile in the "release" profile, but work absolutely fine in the "debug" profile. I'm using VC++2003.
It's far from the first time I've had to do battle with LNK2001's - but this time I'm thoroughly confused, and more importantly don't really know how to solve it.
Any help would be
really appreciated!
CGameError.obj : error LNK2001: unresolved external symbol "__int64 std::_Fpz" (?_Fpz@std@@3_JA)
CGameError.obj : error LNK2001: unresolved external symbol "long const std::_BADOFF" (?_BADOFF@std@@3JB)
CGameError.obj : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
CGameError.obj : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
CGameError.obj : error LNK2001: unresolved external symbol "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ)
CGameError.obj : error LNK2001: unresolved external symbol "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " (?_Getfacet@locale@std@@QBEPBVfacet@12@I@Z)
CGameError.obj : error LNK2001: unresolved external symbol "public: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@QAEXXZ)
CGameError.obj : error LNK2001: unresolved external symbol __Towlower
CGameError.obj : error LNK2001: unresolved external symbol __Towupper
CGameError.obj : error LNK2001: unresolved external symbol __Getwctype
CGameError.obj : error LNK2001: unresolved external symbol __Getwctypes
CLogFile.obj : error LNK2001: unresolved external symbol "struct _iobuf * __cdecl std::_Fiopen(char const *,int,int)" (?_Fiopen@std@@YAPAU_iobuf@@PBDHH@Z)
My normal routine for this would be to look up the functions it moaning about and find out what lib file they need to be linked against and then add that to the project properties as appropriate...
Odd things I don't get:
- They all appear to be internal/implementation functions due to being prefixed with "_" or "__". I know it's likely that the code I call is, as part of the implementation, calling these - but it doesn't make much sense to me that they're exposing themselves.
- I've tried looking up some of the functions in all the usual places and they don't even seem to exist. I can't even find them in any header files installed on my machine ([oh]). Having no documentation only adds to the fun.
- The linker errors all refer to CGameError.obj - which is a very simple wrapper class for exceptions - it doesn't really do anything beyond store whatever was passed to the constructor. There are no errors/warnings with this class, and apart from (recently) changing all the std::string to std::wstring it hasn't been touched.
- The library search order seems to be a bit off to me, but I don't get how to sort it out. I've seen references to some similarly named functions in the docs (towupper instead of __Towupper) linking to libcp.lib and libc.lib. It seems that the debug build pulls libcpd.lib from the VC7 installdir, whereas the release build pulls lpcp.lib from the PSDK installdir. But I don't know how to change this as those lib's are pulled in by compiler switches (/ML and /MLd iirc)
Can anyone give me
any ideas for this? I'm gonna go bald due to tearing my own hair out for this one [sad]
Cheers,
Jack