I am attempting to compile a program file named MM.c
. However, I continue to get the error message "microtime.h: No such file or directory". Even though clearly you can see in the image that the microtime.h
file is in the same directory.
Asked
Active
Viewed 135 times
-1

Zois Tasoulas
- 1,242
- 1
- 11
- 23
-
Add the current directory to the list of include directories (use the flag `-I./`) along with your command. – Jardel Lucca Oct 24 '21 at 00:44
-
5[Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/q/285551/995714). Just copy the console text and paste here – phuclv Oct 24 '21 at 00:45
-
Does this answer your question? [gcc Can't Find a Included Header](https://stackoverflow.com/questions/2139920/gcc-cant-find-a-included-header) – user202729 Oct 24 '21 at 00:46
-
1Popsting a link to an image is not really helpful for us. Could you please post a minimal amount of code (in text form, not an image) that demonstrates the problem. And if you need to put the text of the compile command and the error message, do that too. But in the absence of that, did you by any chance use angle brackets in your `#include` command instead of double-quotes? There is a difference - you need to look it up. – DavidHoadley Oct 24 '21 at 00:46
-
Actually in this case a better solution would be to put both the console text *and* the image (for the syntax highlighting) – user202729 Oct 24 '21 at 00:46
-
MM.C File: #include
#include "microtime.h" #include – TMI- The Moester Incorporation Oct 24 '21 at 03:40#include #define BAD 0 #define BETTER 1 #define LoopOrder BETTER /* BAD or BETTER */ int main(int argc, char **argv) { int N, i, j, k; float *A, *B, *C, result=0.0; double time1, time2; -
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 24 '21 at 04:33
1 Answers
0
You're using <>
to delimit the name of the header file. That tells the preprocessor to look only in system include directories or those specified by the -I
option.
Application header files should be delimited with double quotes instead.
#include "microtime.h"

dbush
- 205,898
- 23
- 218
- 273