gpt4 book ai didi

c++ - 无法在 Visual Studio 2010 中构建 C++ 项目

转载 作者:行者123 更新时间:2023-11-27 23:26:24 25 4
gpt4 key购买 nike

我从这个链接下载了这个 C++ 项目:http://www.codeproject.com/Articles/9903/Calling-Managed-Code-from-Unmanaged-Code-and-vice

然后尝试使用 Visual Studio 2010 编译它,我遇到了一些问题:

Error   3   error LNK2028: unresolved token (0A00000F) "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function "public: __clrcall Managed_Wrapper::Managed_Wrapper_Class::Managed_Wrapper_Class(void)" (??0Managed_Wrapper_Class@Managed_Wrapper@@$$FQ$AAM@XZ)  C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Managed_Wrapper.obj  Managed_Wrapper
Error 4 error LNK2028: unresolved token (0A000010) "void * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z) referenced in function "public: __clrcall Managed_Wrapper::Managed_Wrapper_Class::Managed_Wrapper_Class(void)" (??0Managed_Wrapper_Class@Managed_Wrapper@@$$FQ$AAM@XZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Managed_Wrapper.obj Managed_Wrapper
Error 5 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Stdafx.obj Managed_Wrapper
Error 6 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Unmanaged.obj Managed_Wrapper
Error 7 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Unmanaged.obj Managed_Wrapper
Error 8 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\AssemblyInfo.obj Managed_Wrapper
Error 9 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\AssemblyInfo.obj Managed_Wrapper
Error 10 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Managed_Wrapper.obj Managed_Wrapper
Error 11 error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Managed_Wrapper.obj Managed_Wrapper
Error 12 error LNK2019: unresolved external symbol "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z) referenced in function "public: __clrcall Managed_Wrapper::Managed_Wrapper_Class::Managed_Wrapper_Class(void)" (??0Managed_Wrapper_Class@Managed_Wrapper@@$$FQ$AAM@XZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Managed_Wrapper.obj Managed_Wrapper
Error 13 error LNK2019: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@$$FYAPAXI@Z) referenced in function "public: __clrcall Managed_Wrapper::Managed_Wrapper_Class::Managed_Wrapper_Class(void)" (??0Managed_Wrapper_Class@Managed_Wrapper@@$$FQ$AAM@XZ) C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\Managed_Wrapper.obj Managed_Wrapper
Error 14 error LNK2001: unresolved external symbol __CorDllMain@12 C:\Users\310052290\Desktop\DemoProject\Managed_Wrapper\LINK Managed_Wrapper
Error 15 error LNK1120: 6 unresolved externals C:\Users\310052290\Desktop\DemoProject\Managed_VBdotNET\Release\Managed_Wrapper.dll Managed_Wrapper

如何解决在 Visual Studio 2010 中编译 C++ 项目的问题?

提前致谢。

最佳答案

您应该从 Configuration Properties 中删除 /Zl -> C/C++ -> All Options -> 附加选项

关于c++ - 无法在 Visual Studio 2010 中构建 C++ 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9159819/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com