Arduino in Linux can't find .h file in sketch folder

I know this question has been asked before but I didn't see my particular case. The IDE is able to find it if I include the full path to the header. Without the full path, you can hover over the #include statement and see that it is looking for the header in /tmp/arduino-language-server3357825155/sketch/myheaderfiler.h. Any suggestions on how to fix it without including the full path?

Welcome to the forum

Please post a sketch that illustrates the problem

#include <myHeader.h> will look for the .h file in the standard locations
#include "myHeader.h" will look for the .h file in the sketch folder first then the standard locations. You can also use a relative path in the quote marks

Which version are you using ?

Version 2.2.1 running on Linux mint 21.2 Cinnamon. The sketch is very basic and seems somewhat irrelevant.
3f313622eb5c55637b21b515a2a0ae9f9a3815d4

It goes away when I type the full path,

#include </home/david/Arduino/XIAO_RP2040/arduino_secrets.h>

try

#include "arduino_secrets.h"

do not use the angle brackets < > for local files

1 Like

That's strange, I was sure I already tried that but I guess not.

No pictures of code, please

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

1 Like

The picture was to illustrate the popup message, not the code, so I cropped it out:). I did use code tags for the include statement. I'm still unsure why it seems to be looking in that folder. Oh well. I do appreciate you answering the question. I'm unsure why these forums are so worried about procedure. They will probably all get replaced by AI soon anyway :frowning: I'm not sure if I would rather get beat up by code or a real person:):slight_smile: The stack overflow guys can be harsh.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.