Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Autres questions


Index du Forum » Autres questions » using fxsdk with clangd (neovim)
Bluescreen Hors ligne Membre Points: 3 Défis: 0 Message

using fxsdk with clangd (neovim)

Posté le 28/06/2025 05:50

I've been doing some development for the fx-cg50 using fxsdk/gint and it's going great so far, but I can't seem to get clangd to find the right header files. I've modified CMakeLists.txt to generate a compile_commands.json file, and added the --query-driver option for clangd to find the right compiler (sh-elf-gcc) to my neovim config. It does seem to find the compiler and most of its default header files, including gint, but I get an error where it can't find "stdint-gcc.h".

Has anyone got this working in neovim (or some other editor that uses clangd as its lsp)? VSCode works fine and finds the compiler/includes no problem with the config generated by fxsdk, but I'd rather work with my usual C setup.


Lephenixnoir En ligne Administrateur Points: 25218 Défis: 174 Message

Citer : Posté le 28/06/2025 09:16 | #


This is where you can find that header:

% find $(sh-elf-gcc -print-file-name=include) -name stdint-gcc.h
/home/el/.local/share/fxsdk/sysroot/lib/gcc/sh3eb-elf/14.1.0/include/stdint-gcc.h
% fxsdk path sysroot
/home/el/.local/share/fxsdk/sysroot

Whether it is needed or not, and whether GCC looks there or not, depends on flags including but not limited to -ffreestanding; I mostly forgot about this now as I haven't run into this issue in a few years.
Mon graphe (27 Juin): (MQ || Rogue Life) ; serial gint ; passe gint 3 ; Azur ; ...) || (shoutbox v5 ; v5)
Slyvtt Hors ligne Maître du Puzzle Points: 2645 Défis: 17 Message

Citer : Posté le 28/06/2025 09:20 | #


You can find some previous experience here by KikoodX on vscode : https://www.planet-casio.com/Fr/forums/topic13572-72-gint-un-noyau-pour-developper-des-add-ins.html#191061

This is in French but no doubt you can easily understand.

This is a almost 2,5yr-old post but should remains mostly the same. Sorry, I cannot recall having read something for Neovim.
Do not hesitate to put info here in case of success.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Kikoodx Hors ligne Ancien labélisateur Points: 3043 Défis: 11 Message

Citer : Posté le 28/06/2025 18:12 | #


slight correction Sly, my post is regarding clangd configuration on neovim. so it should work perfectly fine for the op.

nowadays i would probably try running bear -- fxsdk build-cg in order to try to generate compile_commands.json automatically, and fallback on writing compile_flags.txt manually if it fails
ouais ouais
Slyvtt Hors ligne Maître du Puzzle Points: 2645 Défis: 17 Message

Citer : Posté le 28/06/2025 18:14 | #


Ok nice. Thanks Kdx
So this is perfectly in line with the question. Thanks
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Bluescreen Hors ligne Membre Points: 3 Défis: 0 Message

Citer : Posté le 28/06/2025 20:27 | #


Setting compile_flags.txt manually seems to have worked, thanks! I'd tried that before, but I think I was missing the -DFXCG50 flag so some types wouldn't be defined.
The generated compile_commands.json doesn't work since it doesn't find the sysroot/lib/gcc/sh3eb-elf/<version>/include path for stdint-gcc.h. I can add it manually, but that kind of defeats the point of auto generating the file, and clangd still complains about unrecognized compiler flags even though it's set to use the sh-elf-gcc compiler. Unless I find some way of making it work "out of the box", a simple compile_flags.txt is fine, so I think I'll just keep the file around and copy it over to new projects.

For anyone interested, the flags needed (basically the same from the linked thread):

-DFXCG50
-I<path/to/home>/.local/share/fxsdk/sysroot/lib/gcc/sh3eb-elf/<version>/include
-I<path/to/home>/.local/share/fxsdk/sysroot/sh3eb-elf/include

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2025 | Il y a 86 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd