error: stdio.h: No such file or directory error during make

前端 未结 3 680
说谎
说谎 2020-12-30 15:56

I\'m trying to compile the following program in Ubuntu. But I keep getting the error: \"stdio.h: No such file or directory\" error.

#include 
         


        
3条回答
  •  天涯浪人
    2020-12-30 16:04

    Your Makefile isn't correct, please take a look at one of the many tutorials, for example: http://mrbook.org/tutorials/make/

    the simplest Makefile to build a standalone application should look something like that:

    all: hello
    
    hello: hello.o
        gcc hello.o -o hello
    
    hello.o: hello.cpp
        gcc -c hello.cpp
    
    clean:
        rm -rf *o hello
    

    Hope it helps !

提交回复
热议问题