2

I was trying how to create I / O for the new JetBrains' IDE called Fleet. But unfortunately couldn't do so. So, here I am asking the StackOverflow community "How can I configure the run.json file in Fleet".

What am I supposed to write in that file?

I am trying to code C++ file in Fleet.

Andrey
  • 15,144
  • 25
  • 91
  • 187
hhjhjagalga
  • 21
  • 1
  • 3
  • Please provide enough code so others can better understand or reproduce the problem. – Community Nov 30 '22 at 10:36
  • Have you tried checking the Fleet documentation/Help pages? Here: https://www.jetbrains.com/help/fleet/run-configs.html -- it has examples + Fleet will help with code completion as you type. A few more general examples (not specific to C++): 1) https://stackoverflow.com/q/74366488/783119 2) https://stackoverflow.com/a/74184181/783119 – LazyOne Nov 30 '22 at 11:49

1 Answers1

4

This is what I came up with:

{
    "configurations": [
        {
            "type": "command",
            "name": "run",
            "dependsOn": ["build"],
            "program": "$PROJECT_DIR$/solution",
        },
        {
            "type": "command",
            "name": "build",
            "program": "/usr/bin/g++",
            "args": ["$PROJECT_DIR$/main.cpp", "-std=c++17", "-pthread", "-O2", "-o", "solution"],

        },
    ]
}

It's called chained run configuration. You need separate build and run configs, and make the run config depend on the build config. Hope that helps :)