Many R packages contains compiled code, most commonly C. I found some docs about using Geany with R https://wiki.geany.org/howtos/using_geany_with_r but they not mention anything about compiling C code. Could anyone extend documentation on how to setup Geany for R's compiled code? I can imagine this is probably `R CMD SHLIB` command somewhere there. Presently on the line. ``` #include <R.h> ``` I am getting ``` data.table.h:2:10: fatal error: R.h: No such file or directory #include <R.h> ^~~~~ compilation terminated. Compilation failed. ``` Not sure if that matters, but strictly speaking I am interested in C code being highlighted when there are compiler warning/error. I do compilation of a package in a separate shell session. Thank you.
If you compile C in a separate shell there is nothing Geany can do, if you compile it in Geany the compiler errors should be parsed and linked to the source line of the error.
Rists are welcome to upgrade the wiki article as required.
@elextr Thanks for feedback.
I tried to use commands I seen during my compilation: ``` gcc -I"/usr/share/R/include" -DNDEBUG -fopenmp -fpic -O3 -mtune=native -c %f% ``` and it looks to work ``` gcc -I"/usr/share/R/include" -DNDEBUG -fopenmp -fpic -O3 -mtune=native -c "bmerge.c" (in directory: /home/jan/git/data.table/src) Compilation finished successfully. ``` The thing is that I am not getting real-time response about errors. I tried to put some code that uses an undeclared variable and no lines are getting marked as invalid. To spot the issue in the code I have to run compilation of the file again. Maybe I just expect to much and such a real-time response about invalid code is not among the features of Geany?
Maybe I just expect too much and such a real-time response about invalid code is not among the features of Geany?
Correct. Geany only reports errors given to it by the compiler when the compiler is executed. It doesn't do like some IDEs where they highlight errors/warnings in real-time as you type.
Closed #2532.
@codebrainz Thank you. Any idea if there is any plugin that would allow that? or maybe an existing feature request for such functionality, so I can subscribe and be informed if such functionality will be available? Closing this issue as solved, because compilation works fine.
@jangorecki I'm not aware of any current ones. I had previously tried using libclang for C/C++ but ran into some issues integrating it as a plugin (mentioned in #1195). There is also some discussion #1458.
github-comments@lists.geany.org