Build issue in Visual Studio 2010

I use the CS106 library at the university. After changing Visual Studio 2008 from Visual Studio 2010, I had problems creating new or old projects. I think the new Visual Studio is not compatible with the CS106 library. Anyone tell me how to fix this problem?

This is the conclusion:

1>------ Build started: Project: Blank, Configuration: Debug Win32 ------ 1>Build started 3/15/2011 2:03:21 PM. 1>InitializeBuildStatus: 1> Touching "Debug\Blank.unsuccessfulbuild". 1>ClCompile: 1> All outputs are up-to-date. 1>CS106CPPLib.lib(strutils.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(simpio.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) referenced in function "public: class std::basic_string,class std::allocator > & __thiscall std::basic_string,class std::allocator >::assign(class std::basic_string,class std::allocator > const &,unsigned int,unsigned int)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z) 1>CS106CPPLib.lib(genlib.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(init.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xran(void)" (?_Xran@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(strutils.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(simpio.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) referenced in function "protected: bool __thiscall std::basic_string,class std::allocator >::_Grow(unsigned int,bool)" (?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@IAE_NI_N@Z) 1>CS106CPPLib.lib(genlib.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(init.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl std::_String_base::_Xlen(void)" (?_Xlen@_String_base@std@@SAXXZ) 1>CS106CPPLib.lib(simpio.obj) : error LNK2019: unresolved external symbol "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register@facet@locale@std@@CAXPAV123@@Z) referenced in function "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) 1>CS106CPPLib.lib(strutils.obj) : error LNK2001: unresolved external symbol "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register@facet@locale@std@@CAXPAV123@@Z) 1>CS106CPPLib.lib(simpio.obj) : error LNK2001: unresolved external symbol "long const std::_BADOFF" (?_BADOFF@std@@3JB) 1>CS106CPPLib.lib(strutils.obj) : error LNK2001: unresolved external symbol "long const std::_BADOFF" (?_BADOFF@std@@3JB) 1>Debug\Blank.exe : fatal error LNK1120: 4 unresolved externals 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:00.97 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

+4
source share
2 answers

Here is the solution: http://melbsdailydigest.blogspot.com/

1.) Download one of the latest projects from the Stanford CS106B website:

Purpose of CS106B 1

2.) Unzip the project and find its subdirectory \ CS106. This is the folder containing the entire library (CS106CPPLib.lib) and header files for the CS106 program.

3.) (, C:\Assignment1\CS106.

4.) Visual Studio2008 "" > "" > ""... , .

5.) , stdafx.h, stdafx.cpp , , , . / .

6.) "" > " "... (Assign1warmup.cpp).

7.) , , stdafx.h, . . Project- > Assignment1 Properties... ( , ). "" " " → C/++ → . "/ " "" " ".

8.) , , . " → C/++ → " " Include" ..., CS106, .

9.) , , " → C/++ → ". ( Debug.DLL) ( , ).

10.) , , , CS106. . " " → "- > ", - " ". , " ", " " → "Linker- > Input". CS106CPPLIB.lib.

. , , -, - , , , Explorer Explorer. , , . , , . , (.. Cpp), , , , .

Build- > Rebuild Solution. !

+8

. ... #include <string> , ?

+1

All Articles