小编sup*_*har的帖子

如何在 clion 中创建独立的 exe?

当我尝试运行.execmake-build-debug我有一个错误:

“未找到 libgcc_s_dw2-1.dll”。

如何在.exe没有任何dlls. 我用CLion 2017.2.4, MinGW 5.0, cmake 3.9.4

c++ clion

5
推荐指数
1
解决办法
8787
查看次数

无法转换lambda表达式(async/await)

无法将lambda表达式转换为预期的委托类型,因为块中的某些返回类型不能隐式转换为委托返回类型

我想在另一个线程中运行函数,我可以毫无错误地执行此操作,但仅在计算函数不是时void.我想使用void函数.请告诉我该怎么做或它应该返回什么样的结果?

private async void buttonStep3_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = folderBrowserDialog1.ShowDialog();
            if (dialogResult != DialogResult.OK)
                return;

            SetAllButtonsStateEnabled(false);

            progressBar1.Value = 0;
            progressBar1.Visible = true;

            var progressProgressBarValue = new Progress<int>(s => progressBar1.Value = s);

            await Task.Run(() => SizeFilter3(
                                    Convert.ToInt32(textBoxSF1W.Text), Convert.ToInt32(textBoxSF1H.Text),
                                    Convert.ToInt32(textBoxSF2W.Text), Convert.ToInt32(textBoxSF2H.Text),
                                    Convert.ToInt32(textBoxSF3W.Text), Convert.ToInt32(textBoxSF3H.Text),
                                    Convert.ToInt32(textBoxSF4W.Text), Convert.ToInt32(textBoxSF4H.Text),
                                    Convert.ToInt32(textBoxSF5W.Text), Convert.ToInt32(textBoxSF5H.Text),
                                    progressProgressBarValue),
                                TaskCreationOptions.LongRunning);//this line gives an error


            progressBar1.Visible = false;
            progressBar1.Value = 0;

            SetAllButtonsStateEnabled(true);
        }
private void SizeFilter3(int filterW1, int filterH1,
                                   int filterW2, int filterH2,
                                   int filterW3, int filterH3,
                                   int …
Run Code Online (Sandbox Code Playgroud)

c# async-await

4
推荐指数
1
解决办法
353
查看次数

标签 统计

async-await ×1

c# ×1

c++ ×1

clion ×1