0

When i include .h files the compiler says no such file or directory i have installed MinGW in the default path C:\MinGW\ and i have added the MinGW path to environment variables path as C:\MinGW\bin

this is my code

#include <stdio.h>
#include <main.h>

int main()
{
#if (DEBUG_MODE)
    printf("Debug Mode!\n");
#else
    printf("No Debug Mode!\n");
#endif
    return 0;
}

and this is my main.h file

#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED

#define DEBUG_MODE 1

#endif // MAIN_H_INCLUDED

and this is the error

11:02:58 **** Incremental Build of configuration Debug for project test ****
Info: Internal Builder is used for build
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o main.o "..\\main.c" 
..\main.c:10:18: fatal error: main.h: No such file or directory
#include <main.h>
              ^
compilation terminated.

11:02:58 Build Failed. 1 errors, 0 warnings. (took 212ms)
sepp2k
  • 363,768
  • 54
  • 674
  • 675

0 Answers0