Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] compiled file does not run on windows #1114

Open
davidbuzatto opened this issue Mar 18, 2024 · 0 comments
Open

[Bug] compiled file does not run on windows #1114

davidbuzatto opened this issue Mar 18, 2024 · 0 comments

Comments

@davidbuzatto
Copy link

davidbuzatto commented Mar 18, 2024

  • VS Code Version: 1.87.2
  • OS Version: Windows 11 (latest updates)
  • Code Runner Version: 0.12.1

Describe the bug
Depending on the name of the source code file (c and cpp), the extension can compile it, but does not properly execute the compiled file, as the .exe extension ends up being omitted in the generated file.

To Reproduce
An example of a file name that generates the problem would be "test1.1.c". When trying to run "Run", the file "test1.1" is generated, but Windows cannot run it as it is missing the .exe extension. The issue can be mitigated by changing the executor map as follows:

From this:

"code-runner.executorMap": {
    ...
    "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
    ...
}

To that:

"code-runner.executorMap": {
    ...
    "c": "cd $dir && gcc $fileName -o $fileNameWithoutExt.exe && $dir$fileNameWithoutExt.exe",
    ...
}

Actual behavior
Windows doesn't know how to run an executable file that doesn't have the explicit .exe extension.

Expected behavior
Execute the file appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant