Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

User defined header file not find in C

+2 votes
asked Jul 4 by SaluTron Messtechnik GmbH (190 points)
Hello,
I have the following problem. When I try to add the user defined header file in my main project main.c, the compiler report the following error:
fatal error: dotmat.h: No such file or directory
I put the header file dotmat.h and main.c in the same directory and and use the following command:
#include "dotmat.h"

Can someone help to solve this problem?

2 Answers

0 votes
answered Jul 4 by Peter Minarik (55,660 points)

This should work.

Probably your file is missing. Or is spelt with a different casing.

Can you share a link to your project so one could verify? (Save your project, then Share the link. There will be buttons with these titles.)

0 votes
answered Jul 5 by SaluTron Messtechnik GmbH (190 points)
There is a link to the project:

https://onlinegdb.com/hyB9xB4_i
commented Jul 5 by Peter Minarik (55,660 points)
Thats' the thing. In the linked project, there is only one file (main.c), so it's no wonder the compiler will not find the included (test.h) file.

There are two small icons on the left of the big RUN button. One of them is to create a new file, the other is to upload an existing file to the server. Use them to add your test.h and you should be sorted.
commented Jul 6 by SaluTron Messtechnik GmbH (190 points)
Thank you very much for your help. I understood how it works.
commented Jul 6 by Peter Minarik (55,660 points)
I'm glad that you're sorted.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...