需要帮助:编译c ++ [英] Need Help: Compile c++

查看:81
本文介绍了需要帮助:编译c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译用c ++(HELLO.CPP)编写的源代码文件,并获取结果以将其显示在我的项目中.
下面是代码:

字符串fileName = @"D:\ HELLO.CPP";

ICodeCompiler cc =新的CppCodeProvider().CreateCompiler();

编译器参数cp =新的编译器参数();
cp.ReferencedAssemblies.Add("system.dll"); //包括
cp.GenerateExecutable = true; //生成可执行文件

CompilerResults cr = cc.CompileAssemblyFromFile(cp,fileName);
textbox1.Text = cr.Output.ToString(); 

解决方案

您遇到的异常或麻烦是吗?

I'm trying to compile a source code file, written in c++ (HELLO.CPP), and get the result to display it in my project.
Here is the code:

string fileName = @"D:\HELLO.CPP";

ICodeCompiler cc = new CppCodeProvider().CreateCompiler();

CompilerParameters cp = new CompilerParameters();
cp.ReferencedAssemblies.Add("system.dll"); //includes
cp.GenerateExecutable = true; //generate executable

CompilerResults cr = cc.CompileAssemblyFromFile(cp, fileName);
textbox1.Text = cr.Output.ToString();

解决方案

And the exception or trouble you are having is?


这篇关于需要帮助:编译c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆