如何在Windows上使用CMD来构建和运行VS项目? [英] How to use CMD on windows to build&run VS projects?

查看:569
本文介绍了如何在Windows上使用CMD来构建和运行VS项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用VS2017进行OpenCV。但我想使用命令提示符来构建和运行我的项目。因为我可以使用argv [1]参数简单地通过我的应用程序传递图像。但我不知道怎么办呢?在Linux内部很容易,我可以通过这些命令来实现:

 g ++ name_of_app.cpp -o name_of_app 



 ./ name_of_app   / home / path_to_image 





但是在Windows 10中我不知道该怎么做?



我尝试了什么:



我尝试过我在Linux内部尝试的但是没有用!实际上我不知道如何在Windows上执行此操作?

解决方案

您可以从Visual Studio内部向您的应用程序传递参数(并获得使用调试器的优势)同时):

1)在Solution Explorer窗格中打开你的项目。

2)双击Properties分支。

3)在结果页面中,单击左侧的调试选项卡。

4)在启动选项下,您可以输入命令行参数和工作目录。



您可以从命令行执行此操作: c# - 通过命令行构建Visual Studio项目 - Stack Overflow [ ^ ]但是更容易 - 也更灵活 - 留在IDE中。

I am trying OpenCV with VS2017. But I want to use command prompt to build&run my projects. Because I can use "argv[1]" argument simply to pass images trough my apps. But I don't know how can I do it? Inside the Linux it was easy and I could do it by these commands:

g++ name_of_app.cpp -o name_of_app


./name_of_app "/home/path_to_image"



But Inside the Windows 10 I don't know how should I do that?

What I have tried:

I tried what I was trying inside Linux but didn't work! Actually I don't know how to do it on windows?

解决方案

You can pass arguments to your apps from inside Visual Studio (and get the advantages of using the debugger at the same time):
1) Open your project in the Solution Explorer pane.
2) Double click the "Properties" branch.
3) In the resulting page, click the "Debug" tab on the left hand side.
4) Under "Start options" you can enter the command line arguments and working directory.

You can do it from the command line: c# - Build Visual Studio project through the command line - Stack Overflow[^] but it's a lot easier - and more flexible - to stay within the IDE.


这篇关于如何在Windows上使用CMD来构建和运行VS项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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