0

I am a beginner in VS Code. I already installed C/C++ and Code Runner extensions. Also I have copied the C:\msys64\mingw64\bin to Environment variables.

  • Here's the context when I try to run this code in Visual Studio Code:
#include<stdio.h>

int main (){
    int age;
    printf("Enter age\n");
    scanf("%d",&age);
    printf("age is %d",age);
    return 0;
}

-It shows:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:test: file format not recognized; treating as linker script C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:test:3: syntax error collect2.exe: error: ld returned 1 exit status

Is there anyone here can help me fix this? Thank You in Advance.

1 Answers1

0

Just save the code using File-> Save or by using ctrl+S. then, run the code. It worked for me!

yt link for error: https://www.youtube.com/watch?v=1dX-SytgRs4

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 10 '23 at 19:15