2. fatal error LNK1104: cannot open file 'LIBC.lib' (vs2010)
解决方法一:
I could solve this prblem in my case (using library (built with VC++ 2003) for controlling an RFID readers)
1. Include the library file LIBC.LIB into your project (Project -> Ad existing item -> All files -> pick the Lib file)
This step allow the project to build successfully
2. Add LIBC.LIB to the folder corresponding to "C:\Program Files\Microsoft Visual Studio 8\VC\lib"
After that you'll be able to link successfully...
解决方法二:
I made VS2010 work without linking to msvcr100.dll but it's a pain in the a*s, really.
1. First, you have to make your own msvcrt.lib using dumpbin.exe and lib.exe (you have to make it for msvcrt.dll which resides in your system32 / syswow64 folder, depending on the version you need). The msvcrt.lib you get with VS is for MSVCR100.dll, not MSVCRT.dll. And we need the latter one.
2. you have to make a static library with 2 functions: _crt_debugger_hook and __crt_debugger_hook (notice the difference in underlines). Both these functions must be declared as C functions, take no parameters, and return nothing. Their bodies may be empty.
3. In your actual project, enable "ignore all default libraries".
5. Add the following libraries in this exact order: my_own_msvcrt.lib;crt_debugger_hook_static.lib;msvcrt.lib;libcmt.lib;
"my_own_msvcrt.lib" is the one you make in step 1, while "msvcrt.lib" is the original you get with VS2010.
6. Append any additional libs you need.
7. Make your own "main" function which takes no parameters, doesn't return anything, and uses __stdcall calling convention. Make it the executable's entrypoint. Actually the name doesn't matter - you can name it "MyCodeRules" if you wish.
Example declaration:
VOID __stdcall MyMain() {
}
These steps stop VS2010 from linking to msvcr100.dll. They actually make it intelligent and use intrinsic functions almost always. And even if it does link to something sporadically, it will be the plain old msvcrt.dll everyone has in their system folder.
LIMITATIONS: In case you don't know, you pretty much strip all of C++ stuff from your executable, by using the above method, therefore you can use, like, almost nothing c++'ish -- only standard C.
//z 2012-4-23 17:32:07 PM IS2120@CSDN
5. unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
The symbol is defined in msvcrt.lib. You are not linking with that library because you specified the /NODEFAULTLIB linker option. Either remove that option, or add msvcrt.lib as an input library. Thanks for taking the time to report this!
//z 2013-04-28 10:53:35 [email protected] .K[T8,L119,R5,V110]
6. 如何调试 Windows 脚本宿主、 VBScript 和 JScript 文件
REGEDIT4
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}]
@="ScriptDebugSvc Class"
"AppID"="{A87F84D0-7A74-11D0-B216-080000185165}"
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}\LocalServer32]
@="D:\\Program Files\\Microsoft Script Debugger\\msscrdbg.exe"
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}\ProgID]
@="ScriptDebugSvc.ScriptDebugSvc.1"
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}\VersionIndependentProgID]
@="ScriptDebugSvc.ScriptDebugSvc"
将以上几行保存成MSScrDbg.reg文件
然后运行加入到注册表
请先备份注册表