PlayDead2022
PlayDead2022

Reputation: 1

Visual Studio Code, c/c++ extension

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.

#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.

Upvotes: 0

Views: 674

Answers (1)

Prenith John Samuel
Prenith John Samuel

Reputation: 1

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

Upvotes: 0

Related Questions