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

linker error #13131

Open
FROSTEDfbii opened this issue Jan 8, 2025 · 2 comments
Open

linker error #13131

FROSTEDfbii opened this issue Jan 8, 2025 · 2 comments
Assignees
Labels
Language Service more info needed The issue report is not actionable in its current state

Comments

@FROSTEDfbii
Copy link

Issue with Recognizing C/C++ Source File in Visual Studio Code:

Description: "Visual Studio Code is not recognizing my C/C++ source file and is preventing me from building and debugging."
Build Task Not Found in Visual Studio Code:

Description: "The build task 'gcc build active file' is not found in Visual Studio Code, preventing me from compiling my C program."
Linker Error: Undefined Reference to WinMain:

Description: "Encountering a linker error 'undefined reference to WinMain' when compiling a C console application using GCC on Windows."

@ntrogh
Copy link

ntrogh commented Jan 8, 2025

Transferring issue to C++ tools team.

@ntrogh ntrogh transferred this issue from microsoft/vscode-docs Jan 8, 2025
@Colengms
Copy link
Contributor

Hi @FROSTEDfbii . Could you clarify what exactly you're seeing?

"Visual Studio Code is not recognizing my C/C++ source file and is preventing me from building and debugging."
Build Task Not Found in Visual Studio Code

Could you clarify what "not recognizing" means here? Do you mean that it fails to open, fails to enable C/C++ language service features, or something else? "Build Task Not Found" doesn't seem to be directly related to VS Code or the C/C++ extension failing to 'recognize' a source file as C/C++.

The build task 'gcc build active file' is not found in Visual Studio Code, preventing me from compiling my C program.

This usually means VS Code can’t locate the specific task you’re invoking, in your tasks.json file. Can you provide the contents of your tasks.json file?

Encountering a linker error 'undefined reference to WinMain' when compiling a C console application using GCC on Windows.

This would seem to imply that the compiler and linker are running and encountering an error. If you’re using MinGW and passing -mwindows or other flags that set up a Windows GUI subsystem, the linker expects WinMain. Can you provide the command line you're using to build? This behavior seems related to compiler arguments and not the C/C++ Externsion itself.

The best way for us to assist would be if you could provide a simple, isolated repro, in the form of a zip file or a GitHub repo. That would allow us to investigate the issue locally, hopefully seeing exactly what you see. Also, screenshots and Snipping Tools video records could help us understand what you're seeing.

@Colengms Colengms self-assigned this Jan 10, 2025
@Colengms Colengms added Language Service more info needed The issue report is not actionable in its current state labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Service more info needed The issue report is not actionable in its current state
Projects
Status: No status
Development

No branches or pull requests

3 participants