nvim-neorg/tree-sitter-norg

NixOs can't compile parser

LamprosPitsillos opened this issue · 1 comments

Downloading tree-sitter-norg...
Creating temporary directory
Extracting tree-sitter-norg...
Compiling...
cc -c -Os -std=c99 -fPIC -I./src -o parser.o src/parser.c
cc -c -Os -std=c++14 -fPIC -I./src -o scanner.o src/scanner.cc
src/scanner.cc:1:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
1 error generated.
make: *** [/home/inferno/.local/share/nvim/lazy/nvim-treesitter/scripts/compile_parsers.makefi
le:41: scanner.o] Error 1
Error during compilation
Failed to execute the following command:
{
  cmd = "make",
  err = "Error during compilation",
  info = "Compiling...",
  opts = {
    args = { "--makefile=/home/inferno/.local/share/nvim/lazy/nvim-treesitter/scripts/compile_
parsers.makefile", "CC=cc", "CXX_STANDARD=c++14" },
    cwd = "/home/inferno/.local/share/nvim/tree-sitter-norg"                                  
  }
}                                 

I am trying to install a treesitter parser and i get this C++ error, fatal error: 'algorithm' file not found , what could be causing this ?

3rd commented

Ran into this for both norg and one of my grammars.
If this happens it's an issue with the system-installed gcc and not Neorg-related.
Check if entering a shell with nix-shell -p gcc, opening Neovim in it, and installing the Neorg parser works.