Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
574 views
in Technique[技术] by (71.8m points)

compiling C program with gcc; Cannot open output file _.exe: no such file or directory

I just started trying to program in C and I've downloaded all kinds of IDE's and compilers and nothing seems to be working. Cygwin keeps giving me this error when i try to compile my program:

C:UsersPaulDocumentsTimmy
λ gcc -o nutt nutt.c
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: 
cannot open output file nutt.exe: No such file or directory
collect2: error: ld returned 1 exit status.

here is my program

#include <stdio.h>
int main(void) {
    printf("y");
    return 0;
}

I also want to point out that i have this strange issue when i try to use the "save as" features in notepad or notepad++. when i try to save something this way it will bring up an error message saying the file isn't found and to check the file name and try again. both of these issues seem to have occured around the same time, i'm not sure if they are related. I try saving this way by setting the file type to all types and i just type in "something.c" for the name.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I fixed it! thank you guys for trying to help. I fixed it by turning off controlled folder access in my windows defender security center.

https://answers.microsoft.com/en-us/windows/forum/windows_10-files/cant-save-to-documents-folder-after-fall-creators/b1274473-6dcd-4bbf-8040-6ba1bc79287f

I can now use the save as features and compile my C source files.

I kept trying to google stuff about gcc when it was really window's fault...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...