-1

I am new to C programming and I'm facing one of the most annoying issues during my debut. I know this question came up many times, but I honestly could not find any solution. Either the answers contain advanced vocabulary for a beginner, either I try the solution but the problem persists.

I am writing my code on VSCode and already installed the required extensions as well as MinGW and added its directory to my path. I ran the cmd line and checked if gcc is installed correctly. But the issue is whenever I try to run my C-code the command line and VScode give me the following error

"c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file a.exe: No such file or directory collect2.exe: error: ld returned 1 exit status"

Here is my code I already built it and there are no errors:

 #include <stdio.h>

int main()
{
    printf("Hello world/n");

    return 0;
}

I would appreciate any help. Thank you.

463035818_is_not_an_ai
  • 109,796
  • 11
  • 89
  • 185

1 Answers1

0

Here is the solution if you're facing something similar to my issue. stackoverflow.com/a/48493894/66384

All I did is turn off Controlled folder access. The helloworld.exe was blocked by windows defender and labeled it as Trojan and as a "severe threat" :). Can't believe I spent more than an hour trying to fix problems related to the gcc compiler when the problem was from windows.

Thank you all for the help.