靓靓靓亮 2022-03-07 16:01 采纳率: 33.3%
浏览 287

vscode编译出现cpp: fatal error: too many input files

在vscode编译时出现cpp: fatal error: too many input files

img

task.json:


{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "catkin_make:debug",
            "type": "shell",
            "command": "catkin_make",
            "args": [],
            "group": "build",
            "presentation": {
                "reveal": "always"
            },
            "problemMatcher": "$msCompile"
        },
        {
            "type": "cppbuild",
            "label": "C/C++: cpp 生成活动文件",
            "command": "/usr/bin/cpp",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}",

                /* 项目所需的头文件路径 */
                //"-I","${workspaceFolder}/",
                "-I","/opt/ros/noetic/include/**",
                "-I","/home/lxl/catkin_ws/src/program_control/include/**",
                "-I","/usr/include/**",
                "-I","/usr/local/include/",
                "-I","/usr/local/include/opencv4/",
                "-I","/usr/local/include/opencv4/opencv2",

                /* 项目所需的库文件路径 */
                "-L", "/usr/local/lib",
 
                /* OpenCV的lib库 */
                "/usr/local/lib/libopencv_*",
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "调试器生成的任务。"
        }
    ]
}

img

  • 写回答

3条回答 默认 最新

  • 关注

    可能的原因:
    (1)gcc的配置位置发生变化,或者找不到gcc
    (2)gcc版本较低

    查看gcc是否已经安装,如未安装,则安装gcc。如已安装,把gcc升级到一个较高版本。


    gcc tends to report the error message "cpp: too many input files" when it cannot find tools in the places it expects them to be. One cause is if you configured with a --prefix or a --exec-prefix argument with a trailing slash. You must ensure there are no trailing slashes to the arguments to --prefix and --exec-prefix. Another cause is if you have moved your gcc installation from the location you originally specified when it was configured. This location is determined primarily by the --exec-prefix argument to gcc's configure script.

    More recent gcc snapshots do not have this limitation, which is specific to gcc 2.95.2 or earlier. To resolve it, you can: use a more recent gcc snapshot; reconfigure gcc with the intended installation location set correctly; or set up symlinks from the old location to the new one.

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 3月7日

悬赏问题

  • ¥15 Qt4代码实现下面的界面
  • ¥15 prism提示我reinstall prism 如何解决
  • ¥15 asp.core 权限控制怎么做,需要控制到每个方法
  • ¥20 while循环中OLED显示中断中的数据不正确
  • ¥15 这个视频里的stm32f4代码是怎么写的
  • ¥15 JNA调用DLL报堆栈溢出错误(0xC00000FD)
  • ¥15 请教SGeMs软件的使用
  • ¥15 自己用vb.net编写了一个dll文件,如何只给授权的用户使用这个dll文件进行打包编译,未授权用户不能进行打包编译操作?
  • ¥50 深度学习运行代码直接中断
  • ¥20 需要完整的共散射点成像代码