When using makefile to run the executable file generated in the current directory: m akefile:3 : recipe for target 'test' failed code> similar error. It is very likely that the value returned to make after the program running is not 0.
1.test.c
#include<stdio.h>
int main(){
printf("----------------\n");
return 2;
}
2. Makefile
target: requests
[tab] command
must be preceded by the tab key
test : test.c
clang test.c -o test
./test
Command line running: make test code>
3. Modify the return value of the end of test. C program
#include<stdio.h>
int main(){
printf("----------------\n");
return 0;
}
4. Command line operation: make test code>
business as usual!
Similar Posts:
- C Compilation Error: implicit declaration of function xxx is invalid in C99 [-Wimplicit-function-declaration]
- C write and read file via FILE and open method in a+ or r mode
- The solution of “no matching function for call to…” in G + + compilation
- Using SQLite to show undefined reference to ` SQLite3_ open’…
- [Solved] Run-Time Check Failure #2 – Stack around the variable ‘a’ was corrupted
- C++ Error: Run-Time Check Failure #2 – Stack around the variable ‘cc’ was corrupted.
- Openeuler: How to Install OpenSSL
- caffe35793;- 38382;- 39064;src/caffe/net. cpp:8 :18: fatal error: hdf5.h: No such file or directory compilation term…
- [Solved] Ruby cannot load such file — zlib, openssl(LoadError), gem No rule to make target `/include/ruby.h’
- How to Solve Error makefile:3: *** missing separator. Stop.