Comments (6)
你好,今天我也遇到同样的问题,解决方法是
tasks.json文件修改如下
{ "version": "2.0.0", "command": "g++", "type": "shell", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": true, "clear": false }, // 文件路径去掉单引号 "args": ["-Wall","-m32","-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}.exe"], "problemMatcher": { "owner": "cpp", "fileLocation": ["relative", "${workspaceRoot}"], "pattern": { "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } } }
灵感来自
https://stackoverflow.com/questions/12518087/g-fatal-error-no-input-files-windows最后我的系统是windows10
原来单引号也会产生影响……
单引号添加是为了防止路径中出现空格,我会在下个版本修改配置文件并在选择路径时增加空格限制。
感谢分享!
from autovscenv_wpf.
感谢分享,我查看了配置文件,参数大致相同(只是增加了允许显示警告的参数),唯一区别就是把g++换成了gcc
gcc命令在处理C++语法文件时会出现响应错误,如果你用不到任何C++特性是可行的。
至于这个g++报错而gcc无错误的问题我没有办法复现,暂时还没有办法解决。
感谢分享!
from autovscenv_wpf.
你好,今天我也遇到同样的问题,解决方法是
tasks.json文件修改如下
{
"version": "2.0.0",
"command": "g++",
"type": "shell",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
// 文件路径去掉单引号
"args": ["-Wall","-m32","-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}.exe"],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
灵感来自
https://stackoverflow.com/questions/12518087/g-fatal-error-no-input-files-windows
最后我的系统是windows10
from autovscenv_wpf.
原来存在
“
g++: error : d:\wcc\test.cpp":Invalid argument
g++: fatal error : no input files
” 的问题,按照B站一留言把 lauch.json里的最后一行 "preLaunchTask": "gcc" 给注释掉了,结果就是:运行通过,但是不能编译,和up主说的一样,没有产生exe文件,没有解决实质问题;
解决方法:
参考:https://www.jianshu.com/p/b7cc0e36cd5f 这个博客里,
对照他的json文件,把up主的json文件修改了一下就可以了,可以编译+运行成功,下面给出修改后的各json文件:c_cpp_properties.txt
launch.txt
tasks.txt另外需要注意的是,在运行的时候若有错误,再检查下环境变量里path和include是否正确,修改后电脑重启生效。
再次感谢~
from autovscenv_wpf.
感谢分享,我查看了配置文件,参数大致相同(只是增加了允许显示警告的参数),唯一区别就是把g++换成了gcc
gcc命令在处理C++语法文件时会出现响应错误,如果你用不到任何C++特性是可行的。
至于这个g++报错而gcc无错误的问题我没有办法复现,暂时还没有办法解决。
感谢分享!
from autovscenv_wpf.
你好,今天我也遇到同样的问题,解决方法是
tasks.json文件修改如下
{ "version": "2.0.0", "command": "g++", "type": "shell", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": true, "clear": false }, // 文件路径去掉单引号 "args": ["-Wall","-m32","-g", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}.exe"], "problemMatcher": { "owner": "cpp", "fileLocation": ["relative", "${workspaceRoot}"], "pattern": { "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } } }
灵感来自
https://stackoverflow.com/questions/12518087/g-fatal-error-no-input-files-windows最后我的系统是windows10
原来单引号也会产生影响……
单引号添加是为了防止路径中出现空格,我会在下个版本修改配置文件并在选择路径时增加空格限制。
感谢分享!
好的,谢谢!如今开发者或者学生学习C语言非常需要现代、轻量、的开发工具(VScode)来调试C语言,感谢你的一键配置VScode的C语言开发环境和你做的工作!
from autovscenv_wpf.
Related Issues (20)
- [BUG] 萌新求教(初来乍到不懂规矩有误之处还望指出)
- [BUG] 运行报错了
- [BUG] 查找不到7z.exe
- [BUG] collect2.exe: error: ld returned 1 exit status
- [BUG] 我是不改标题的坏人呜呜呜
- [Feature] 提供MinGW-w64的安装选项
- [BUG] 我是不改标题的坏人呜呜呜
- [BUG] 我是不改标题的坏人呜呜呜
- [BUG] 我是不改标题的坏人呜呜呜
- 操作超时 在 System.Net.HttpWebRequest.GetResponse() 在 AutoVsCEnv_WPF.Operators.LanzouLinkResolutor.ReadHttpSourceCode(String url) 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Operators\LanzouLinkResolutor.cs:行号 150 在 AutoVsCEnv_WPF.Operators.LanzouLinkResolutor.Resolve(String LanzouLink) 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Operators\LanzouLinkResolutor.cs:行号 20 在 AutoVsCEnv_WPF.Operators.Installer.StartInstall() 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Operators\Installer.cs:行号 61 在 AutoVsCEnv_WPF.Forms.Installing.StartInstall(Object sender, DoWorkEventArgs args) 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Forms\Installing.xaml.cs:行号 47[BUG] 我是不改标题的坏人呜呜呜
- [BUG] 我是不改标题的坏人呜呜呜
- [BUG]
- [BUG] 我是不改标题的坏人呜呜呜
- [BUG] 我是不改标题的坏人呜呜呜
- [BUG] 我是不改标题的坏人呜呜呜
- [BUG] 报错
- [BUG] 我是不改标题的坏人呜呜呜尝试执行未经授权的操作。 在 Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) 在 Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind) 在 Microsoft.Win32.RegistryKey.SetValue(String name, Object value) 在 System.Environment.SetEnvironmentVariable(String variable, String value, EnvironmentVariableTarget target) 在 AutoVsCEnv_WPF.Operators.PathAdder.AddInUserPath(String newPath) 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Operators\PathAdder.cs:行号 19 在 AutoVsCEnv_WPF.Operators.Installer.StartInstall() 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Operators\Installer.cs:行号 77 在 AutoVsCEnv_WPF.Forms.Installing.StartInstall(Object sender, DoWorkEventArgs args) 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Forms\Installing.xaml.cs:行号 47
- [Feature] 新功能建议
- 一次错误
- [BUG] 我是不改标题的坏人呜呜呜未能找到aria2c.exe 尝试查找的目录为libs\aria2c.exe 在 AutoVsCEnv_WPF.Operators.DownloadHelper.Download(String url, String saveDirectory) 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Operators\DownloadHelper.cs:行号 20 在 AutoVsCEnv_WPF.Operators.Installer.StartInstall() 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Operators\Installer.cs:行号 70 在 AutoVsCEnv_WPF.Forms.Installing.StartInstall(Object sender, DoWorkEventArgs args) 位置 D:\Projects\WPF\AutoVsCEnv_WPF\AutoVsCEnv_WPF\Forms\Installing.xaml.cs:行号 47
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autovscenv_wpf.