Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22091

Can't run C code when using top right button in vscode, it runs by clicking run code

$
0
0

I am learning C from w3schools and Bro Code on YouTube. I wrote exactly the same code as he did but encountered the problem.

C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:1hr_in: file format not recognized; treating as linker scriptC:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:1hr_in:4: syntax errorcollect2.exe: error: ld returned 1 exit status

I installed the compiler manually from winlibs because it couldn't auto install. It always crashed no matter what, so I manually installed mingw-w64.

#include <stdio.h>#include <math.h>int main(){double A;double B;double C;printf("Enter Side A: ");scanf("%lf", &A);printf("Enter Side B: ");scanf("%lf", &B);C = sqrt(A*A + B*B);printf("Side C: %lf", C);    return 0;}

This is my code which seems to be accurate after watching it for hours and matching it to the tutorial.When I select all of this code and click on run code it runs smoothly, but when I use the top right run button it doesn't. I'm confused.


Viewing all articles
Browse latest Browse all 22091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>