# VSCode error when launching: The following argument was not expected: /c

**URL:** <https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628>\
**Category:** Programming & Scripting\
**Tags:** error-building, error-launch, unreal-engine, CPP\
**Created:** [February 3, 2024, 12:31pm UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628 "2024-02-03T12:31:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![staticvoidlol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@staticvoidlol](https://forums.unrealengine.com/u/staticvoidlol)\
**Post date:** [February 3, 2024, 12:31pm UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/1 "2024-02-03T12:31:43Z")

</div>

When trying to launch my C++ project from VSCode I get an error popup stating:

```auto
The following argument was not expected: /c
Run with --help for more information

```

Another error pops up in the bottom right with:

```auto
Unable to start program '....<path to UnrealEditor.exe>'. Unable to start the Microsoft Visual Studio Debug Console.

```

The log file just shows this:

```auto
Generated code is up to date.
Target is up to date
Total execution time: 0.40 seconds
WriteFileIfChanged() wrote 0 changed files of 0 requested writes.
Timeline:

[0.000]
[0.000](+0.399) <unknown>
[0.399]

```

I’ve found only one possibly promising thread on the internet: [https://www.reddit.com/r/VisualStudio/comments/vacmua/vs2022\_unable\_to\_debug\_console\_programs/](https://www.reddit.com/r/VisualStudio/comments/vacmua/vs2022_unable_to_debug_console_programs/)

Seems it might be related to environment variables being too long for the MS Debugger?

This happens on a fresh new empty C++ project as well.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![Arodi007](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/arodi007/32/1022275_2.png) [@Arodi007](https://forums.unrealengine.com/u/Arodi007)\
**Post date:** [February 3, 2024, 1:55pm UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/2 "2024-02-03T13:55:15Z")

</div>

Try to disable your firewall & antivirus too.

Did you install VScode and unreal in C and your unreal project in it default folder c document ?

Yes it could be related to an environment variable.

(personal pref) i suggest using visual studio, my friend had lot of issues with vscode and seem to catch less user error compared to visual studio such as using reserve word name.

---

<div class="post-metadata">

**Author:** ![staticvoidlol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@staticvoidlol](https://forums.unrealengine.com/u/staticvoidlol)\
**Post date:** [February 3, 2024, 8:59pm UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/3 "2024-02-03T20:59:53Z")

</div>

Disabling antivirus & firewall, didn’t help unfortunately.

Reverting to a previous version of VSCode resolved the issue.

---

<div class="post-metadata">

**Author:** ![vitasso](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vitasso](https://forums.unrealengine.com/u/vitasso)\
**Post date:** [February 3, 2024, 10:06pm UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/4 "2024-02-03T22:06:10Z")

</div>

There’s an issue at VSCode’s github describing a similar problem to ours ([issue here](https://github.com/microsoft/vscode/issues/204073)). It seems that the problem is at the launch.json file. The “console”: “externalTerminal” command is not valid anymore. Changing it to **“console”: “internalConsole”** works, even though it doesn’t open an external window like the old command.

---

<div class="post-metadata">

**Author:** ![Casmoo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Casmoo](https://forums.unrealengine.com/u/Casmoo)\
**Post date:** [February 7, 2024, 7:17pm UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/5 "2024-02-07T19:17:20Z")

</div>

This is the solution. For those coming from Google, it might be also in the file: _.code-workspace_.

---

<div class="post-metadata">

**Author:** ![oleksii-dtsc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oleksii-dtsc](https://forums.unrealengine.com/u/oleksii-dtsc)\
**Post date:** [February 20, 2024, 2:16pm UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/6 "2024-02-20T14:16:25Z")

</div>

I can confirm - this worked for me.

---

<div class="post-metadata">

**Author:** ![SimonLee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/simonlee/32/909077_2.png) [@SimonLee](https://forums.unrealengine.com/u/SimonLee)\
**Post date:** [February 22, 2024, 7:44am UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/7 "2024-02-22T07:44:37Z")

</div>

It wokrs for me!  
I’m using UE4.26, and I’ve changed the launch.json as below:

From

```auto
"externalConsole": true,

```

To:

```auto
"console": "integratedTerminal",

```

---

<div class="post-metadata">

**Author:** ![boocs\_ved](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@boocs\_ved](https://forums.unrealengine.com/u/boocs_ved)\
**Post date:** [February 26, 2024, 6:56am UTC](https://forums.unrealengine.com/t/vscode-error-when-launching-the-following-argument-was-not-expected-c/1662628/8 "2024-02-26T06:56:37Z")

</div>

I created a temporary extension to fix this. It also has a Revert command. This extension shouldn’t be needed once VSCode fixes the bug.

[https://github.com/boocs/unreal-console-fix/](https://github.com/boocs/unreal-console-fix/)
