Tag: 编译器错误

编译器错误C3493:'func'不能隐式捕获,因为没有指定默认捕获模式

你能帮我解决这个编译器错误吗? template<class T> static void ComputeGenericDropCount(function<void(Npc *, int)> func) { T::ForEach([](T *what) { Npc *npc = Npc::Find(what->sourceId); if(npc) func(npc, what->itemCount); // <<<<<<< ERROR HERE // Error 1 error C3493: 'func' cannot be implicitly captured because no default capture mode has been specified }); } static void PreComputeNStar() { // … ComputeGenericDropCount<DropSkinningNpcCount>([](Npc *npc, int i) { […]

getSupportFragmentManager()。getFragments()显示编译时错误

调用getSupportFragmentManager().getFragments()显示下面的消息编译时间错误: getSupportFragmentManager()。getFragments()只能从同一个库组中调用(groupId = com.android.support) 我在MainActivity导入了以下类: import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.MenuItem; import android.widget.Toast; MainActivity扩展了AppCompatActivity 。 我的项目模块级build.gradle文件如下: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.mycompany.floatingdemo" minSdkVersion 16 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } […]

Visual Studio 2015更新3 – C ++编译器错误?

我们观察到一个奇怪的情况,在VS2015 Update3编译器中将会忽略部分代码,原因不明。 我们发现了这一点 这发生在VS2015 Update3(帮助|关于说14.0.25431.01更新3,cl.exe版本19.00.24215.1) 这不会发生在VS2015 Update2(帮助|关于说14.0.25123.00更新2,cl.exe版本19.00.23918) 只有打开优化时才会发生这种情况(例如,在默认的“发行”configuration中) 在x86和x64中都会发生 将代码片段插入全新的“Win32控制台应用程序”(我的意思是,没有花哨的命令行选项要求) 我们设法最小化这个片段的罪魁祸首代码: #include <stdio.h> #include <tchar.h> #include <stdlib.h> int _tmain(int, _TCHAR*[]) { volatile int someVar = 1; const int indexOffset = someVar ? 0 : 1; // Loop omitted // const int indexOffset = !someVar; // Loop omitted // const int indexOffset = 0; // Good […]

不能将types'System.Collections.Generic.IEnumerable <AnonymousType#1>'隐式转换为'System.Collections.Generic.List <string>

我有下面的代码: List<string> aa = (from char c in source select new { Data = c.ToString() }).ToList(); 但是关于 List<string> aa = (from char c1 in source from char c2 in source select new { Data = string.Concat(c1, ".", c2)).ToList<string>(); 编译得到错误 不能将types'System.Collections.Generic.List<AnonymousType#1>'隐式转换为'System.Collections.Generic.List<string>' 需要帮忙。

什么“意外的预编译头错误”是什么意思?

我试图构build一个涉及Windows和控制台应用程序的简单解决scheme。 使用向导生成项目的代码框架后,我没有添加任何代码,只是build立了生成的代码。 在这两种情况下,我得到了同样的错误: 1>c:\c\winpr\winpr\winpr.cpp(4) : fatal error C1859: 'Debug\winpr.pch' unexpected precompiled header error, simply rerunning the compiler might fix this problem 什么是错的,有什么想法?

“EnsureBindingRedirects”任务意外失败

错误,当我从vs2012创build新的ASP.NET 4.5网页表单应用程序,并更新所有nuget包..我在构build上收到此错误。 Error 1 The "EnsureBindingRedirects" task failed unexpectedly. System.NullReferenceException: Object reference not set to an instance of an object. at Roxel.BuildTasks.EnsureBindingRedirects.MergeBindingRedirectsFromElements(IEnumerable`1 dependentAssemblies) at Roxel.BuildTasks.EnsureBindingRedirects.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()

意外的文件错误结束

我希望你能帮助我,因为我不知道发生了什么。 在尝试将Beecrypt库添加到我的项目时出现以下错误: 致命错误C1010:在查找预编译头文件时出现意外的文件结尾。 你忘了添加“#include”stdafx.h“”到你的源? 其实我没有忘记添加#include“stdafx”给我的来源。 编译器将错误指向该.cxx文件的末尾: #define BEECRYPT_CXX_DLL_EXPORT #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "beecrypt/c++/security/SecureRandom.h" #include "beecrypt/c++/security/SecureRandomSpi.h" #include "beecrypt/c++/security/Security.h" using namespace beecrypt::security; SecureRandom* SecureRandom::getInstance(const String& algorithm) throw (NoSuchAlgorithmException) { Security::spi* tmp = Security::getSpi(algorithm, "SecureRandom"); assert(dynamic_cast<SecureRandomSpi*>(tmp->cspi)); SecureRandom* result = new SecureRandom(reinterpret_cast<SecureRandomSpi*>(tmp->cspi), tmp->prov, tmp->name); delete tmp; return result; } SecureRandom* SecureRandom::getInstance(const String& type, const String& provider) […]

Java:在重载的构造函数之间进行select

根据这个问题 ,当尝试在模糊的重载构造函数之间进行select时,Java将select“最具体的”选项。 在这个例子中: public class Test{ private Test(Map map){ System.out.println("Map"); } private Test(Object o){ System.out.println("Object"); } public static void main(String[] args){ new Test(null); } } 它会打印 “地图” 但是,我试图弄清楚“最具体”的含义。 我认为这意味着“最不明确”,就像“可能指的是尽可能less的types”。 在这种情况下, Object可能是任何不是原始的东西,而Map可能只是Map或? extends Map ? extends Map 。 基本上,我认为select哪个类更靠近inheritance树的叶子。 当一个类是另一个类的子类时,这是有效的: public class Test{ private Test(A a){ System.out.println("A"); } private Test(B b){ System.out.println("B"); } public static void […]

GCC可以不抱怨未定义的引用吗?

尝试调用组合函数时,GCC在什么情况下不能抛出“未定义的引用”链接错误消息? 例如,这个C代码被GCC编译和链接的情况: void function() { made_up_function_name(); return; } 即使made_up_function_name不存在于代码中的任何地方 (不是头文件,源文件,声明或任何第三方库)。 GCC可以在一定条件下接受和编译这样的代码,而不必触摸实际的代码? 如果是这样,哪个? 谢谢。 编辑:没有以前的声明或提到made_up_function_name是否在其他地方。 这意味着整个文件系统的grep -R将只显示确切的单行代码。

编译时QVision Widget错误

只有一个错误,直到我将其用于我的研究! Warning: Z-order assignment: " is not a valid widget. FILE: qvvideoreaderblockwidget.ui 没有线路号码。 我试图find,但没有看到一个开放式的部分。 我该怎么做才能正确编译这个库?