- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在从未安装过任何 IDE/开发工具的全新 Win10 安装上安装了 Visual Studio Community 2015。
我创建了一个空的c++项目,添加了main.cpp
,将入口点设置为main
并添加了:
void main()
{
}
在 VS2013
上我可以毫无问题地做到这一点。我遇到了我无法弄清楚的链接器错误:
Severity Code Description File Line
Error LNK2019 unresolved external symbol __CrtDbgReport referenced in function __CRT_RTC_INIT C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_init_.obj) 1
Error LNK2019 unresolved external symbol __CrtDbgReportW referenced in function __CRT_RTC_INITW C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_init_.obj) 1
Error LNK2019 unresolved external symbol ___stdio_common_vsprintf_s referenced in function __vsprintf_s_l C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_error_.obj) 1
Error LNK2019 unresolved external symbol __wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj) 1
Error LNK2019 unresolved external symbol __wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj) 1
Error LNK2019 unresolved external symbol _wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned int)" (?GetPdbDllPathFromFilePath@@YAHPB_WPA_WI@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj) 1
Error LNK2019 unresolved external symbol ___vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj) 1
Error LNK2019 unresolved external symbol ___vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj) 1
Error LNK2019 unresolved external symbol ___vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPAUHINSTANCE__@@XZ) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_pdblkup_.obj) 1
Error LNK2019 unresolved external symbol __except_handler4_common referenced in function __except_handler4 C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\MSVCRTD.lib(_chandler4gs_.obj) 1
Error LNK1120 10 unresolved externals C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\Debug\ConsoleApplication1.exe 1
更新:
我更改了两个配置属性:
是(/NODEFAULTLIB)
默认
这让我构建了上面的代码,但是在添加了一些其他琐碎的代码之后,我遇到了很多其他问题:
#include <string>
using namespace std;
void main()
{
string blah = "string";
}
包含一个标准库应该是微不足道的,但是:
Severity Code Description File Line
Error LNK2019 unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) referenced in function "void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)" (?_Allocate@std@@YAPAXII_N@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) referenced in function "void __cdecl std::_Deallocate(void *,unsigned int,unsigned int)" (?_Deallocate@std@@YAXPAXII@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol __imp___invalid_parameter referenced in function "void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)" (?_Allocate@std@@YAPAXII_N@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Lockit::_Lockit(int)" (__imp_??0_Lockit@std@@QAE@H@Z) referenced in function "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Lockit::~_Lockit(void)" (__imp_??1_Lockit@std@@QAE@XZ) referenced in function "public: void __thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all@_Container_base12@std@@QAEXXZ) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol _memcpy referenced in function "public: static char * __cdecl std::char_traits<char>::copy(char *,char const *,unsigned int)" (?copy@?$char_traits@D@std@@SAPADPADPBDI@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol __imp__memmove referenced in function "public: static char * __cdecl std::char_traits<char>::move(char *,char const *,unsigned int)" (?move@?$char_traits@D@std@@SAPADPADPBDI@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol _strlen referenced in function "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" (?length@?$char_traits@D@std@@SAIPBD@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol __imp___CrtDbgReportW referenced in function "void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)" (?_Allocate@std@@YAPAXII_N@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (__imp_?_Debug_message@std@@YAXPB_W0I@Z) referenced in function "void __cdecl std::_Debug_pointer<char const >(char const *,wchar_t const *,unsigned int)" (??$_Debug_pointer@$$CBD@std@@YAXPBDPB_WI@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xbad_alloc(void)" (__imp_?_Xbad_alloc@std@@YAXXZ) referenced in function "void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)" (?_Allocate@std@@YAPAXII_N@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" (__imp_?_Xlength_error@std@@YAXPBD@Z) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xlen(void)const " (?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xout_of_range(char const *)" (__imp_?_Xout_of_range@std@@YAXPBD@Z) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xran(void)const " (?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol @__security_check_cookie@4 referenced in function __unwindfunclet$??0?$_String_alloc@U?$_String_base_types@DV?$allocator@D@std@@@std@@@std@@QAE@ABV?$allocator@D@1@@Z$0 C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol __CxxThrowException@8 referenced in function __catch$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z$1 C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol ___CxxFrameHandler3 referenced in function __unwindfunclet$??0?$_String_alloc@U?$_String_base_types@DV?$allocator@D@std@@@std@@@std@@QAE@ABV?$allocator@D@1@@Z$0 C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2019 unresolved external symbol ___security_cookie referenced in function "public: __thiscall std::_String_alloc<struct std::_String_base_types<char,class std::allocator<char> > >::_String_alloc<struct std::_String_base_types<char,class std::allocator<char> > >(class std::allocator<char> const &)" (??0?$_String_alloc@U?$_String_base_types@DV?$allocator@D@std@@@std@@@std@@QAE@ABV?$allocator@D@1@@Z) C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\main.obj 1
Error LNK2001 unresolved external symbol __load_config_used C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\ConsoleApplication1\LINK 1
Error LNK1120 18 unresolved externals C:\Users\[user]\Desktop\VS_TEST\ConsoleApplication1\Debug\ConsoleApplication1.exe 1
最佳答案
好吧,我明白了,但这引出了另一个问题。
问题是 我在 Linker 中定义 /ENTRY:Main
> Advanced> 入口点 除了入口点是Main
而不是main
。
所有路径/库都井井有条,令人惊讶。我撤消了问题中“更新:”行下提到的配置更改 - 这不是问题所在。 p>
真正奇怪的是,我绝对可以在 Visual Studio 2013(我从中迁移了项目)中完全按照上述方式进行操作。也许更奇怪.. 我还有另一个项目,我也以同样的方式迁移了 also 将 Main
明确声明为入口点,但它没有收到链接器的投诉.
关于c++ - 无法在 Visual Studio Community 2015 中编译基本程序(LNK2019 - MSVCRTD.lib),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35607238/
这个问题已经有答案了: mysql community server vs mysql installer (5 个回答) 已关闭 3 年前。 此帖子已于 1 年前编辑并提交审核,但未能重新打开帖子:
我创建一条 snmp 消息 (SNMP4J),并且需要设置“读取社区公共(public)”和“写入社区私有(private)”。 从示例中设置社区: // Specify receiver Addre
当我尝试安装 mysql-community-release 时,出现以下错误: # yum install mysql-community-release Loaded plugins: faste
今天因为想要安装下mysql,然后就去官网准备下载个最新的mysql的社区版本。 但是!下载下来是一个压缩包,那就意味着我们需要手动配置下mysql的环境了。 步骤如下: 1.将压缩包解压到你
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
在64位构建计算机上运行时,我从MSBuild Community Tasks Project遇到Attrib任务时遇到问题。 我整理了这个小测试项目,以说明问题所在:
我想实现 sonarqube 作为代码覆盖工具,但我不确定我要使用企业版还是社区版,它们之间有什么区别? 最佳答案 这完全取决于您的需求: 社区版: 它带有您需要的日常功能,例如 QualityGat
我在Windows 7 64bit上使用PyCharm Community Edition 3.4.1。 每当我在PyCharm中打开我的项目时,都会出现一个窗口,说 “清除只读状态”: [x]使用文
难道只能在Pycharm Professional Edition中创建类图吗? 我有Pycharm Community Edition 2019.2,并且已经安装了PlantUML plugin和G
我在互联网上看到很多关于 Alfresco Share 集群 的相互矛盾的信息。据我所知,在 4.2 及更高版本 中,集群似乎已从 Alfresco Community 中完全删除。 我确实找到了一些
我使用的是 Visual Studio 2017 社区版,但我不知道如何切换“智能标记”功能(帮助程序、自动修复、建议工具)。 它通常显示为一个可以悬停的小方 block ,一旦悬停在错误上。这个交互
library(igraph) g=graph.famous("Zachary") c=walktrap.community(g) a=community.to.membership(g,c$merg
我尝试安装 mysql在 centos-7第一次,我做了这些步骤 须藤百胜本地安装https://dev.mysql.com/get/mysql80-community-release-el7-1.n
我正在为一个科学项目工作,并且想使用Amazon EC2来托管该项目。 现在,我正在研究现有的AMI,以创建自己的AMI,但是在AMI的社区列表中找到了一个AMI-非常合适。 我的问题是:社区AMI安
在让女妖为Windows进行编译的研究中,我偶然发现了this post。在Linux社区中,似乎仍然存在许多对Mono的怀疑,因为它是Microsoft置于FOSS之下的定时炸弹。 几天前,我读到M
我写信是为了通知我一段时间前使用 brew (High Sierra) 安装了 mongodb-community 并且它正在运行。然后最近我升级了,它似乎没有连接起来。当我在终端中运行 mongo
我使用 fastgreedy.community 生成一个社区对象,其中包含 15 个社区。但是我怎样才能在这 15 个社区中提取最大的社区呢? Community sizes 1 2 3
我有两个简单的表如下: public class MediaPartner { [PrimaryKey, AutoIncrement] public int Id { get; set
我如何才能整合数百万个文档的Alfresco Community Edition CMIS存储库和一个Oracle RDBMS存储库,该存储库存储相同文档的元数据,通过Apache ManifoldC
我已在 Microsoft Windows 2008 R2 服务器上安装了 Cassandra 的 DataStax 社区版。在单节点集群中运行是没有问题的。问题是当我尝试向集群添加第二个节点时。对
我是一名优秀的程序员,十分优秀!