libctru icon indicating copy to clipboard operation
libctru copied to clipboard

1. In included file: 'sys/lock.h' file not found [pp_file_not_found]

Open lampda opened this issue 1 year ago • 4 comments

this one is weird, i have this problem where the lsp indicates me that, but when i compile the code it compiles and it really works at the moment of using the 3dsx in citra; i looked for that header file in the repo and in my system but it doesn't seem to appear

Environment?

  • What host OS are you using? i am using Pop!_OS 22.04 LTS x86_64 6.9.3-76060903-generic

lampda avatar Jul 27 '24 17:07 lampda

@MarcosIgnacioo : does this also happen with one of the examples we have? i could spin up a Pop!_OS VM to try and replicate this

DacoTaco avatar Jul 28 '24 12:07 DacoTaco

I've deleted your comment where you "solved" your issue @MarcosIgnacioo since what you did is massively inappropriate and will mainly cause other problems. You shoud never set CPATH globally in your environment as this will affect all the compilers on your system potentially causing them to parse incorrect include paths. The cross compilers we use should never be told to use /usr/include - that's only for the host compiler. There is absolutely no requirement for you to compile newlib in order to have your LSP parse headers. <sys/lock.h> is a compiler header.

The problem is that you haven't configured your LSP properly to allow it to query the compiler for include paths and afaik it will default to using the host compiler. How you do this rather depends on your IDE and how it's configured to use LSP/clangd.

Which editor are you using?

WinterMute avatar Jul 28 '24 20:07 WinterMute

@MarcosIgnacioo please stop adding your inappropriate "fixes" in the comments. Your configuration is wrong. You should not add random paths to your LSP config file. Seems to work fine and actually does work fine are two entirely different things.

What IDE are you using?

WinterMute avatar Aug 01 '24 19:08 WinterMute

@MarcosIgnacioo please stop adding your inappropriate "fixes" in the comments. Your configuration is wrong. You should not add random paths to your LSP config file. Seems to work fine and actually does work fine are two entirely different things.

What IDE are you using?

neovim

lampda avatar Aug 02 '24 22:08 lampda