![](/img/trans.png)
[英]create and compile “hello world” application in Linux using Visual Studio Code
[英]Trouble running a simple "Hello world" using Visual Studio code
我最近開始學習 C++ 但是我什至無法獲得一個簡單的程序來運行。 我正在使用 Visual Studio Code,並使用本教程https://code.visualstudio.com/docs/cpp/config-mingw來設置 C++。 我遵循了每一步,直到這一點也沒有出現任何錯誤。 每當我嘗試在 Visual Studio Code 中從終端運行 helloworld.exe 時,什么都沒有發生,甚至沒有出現任何錯誤。 請幫忙!
(附帶問題:每次我想運行我的代碼的更新版本時,我是否必須在使用 Ctrl+Shift+B 運行它之前構建它?另外,你必須通過終端運行代碼嗎?有沒有容易按運行按鈕或快捷方式,如 PyCharm 中的 Python 運行代碼?)
我的建議是您使用 cd 和文件夾名稱打開終端和 go 到您的文件夾,然后編譯文件:
g++ filename.cpp
並運行它:
./a.out
對於 windows 的 Unix 系統,我認為是:
./a.exe
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.