Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    kangyampeta srinivas
    /env_build/cmake/CMake/bin/cmake --build Release
    [ 2%] Linking CXX executable ccls
    /usr/bin/ld: cannot find -lncurses
    collect2: error: ld returned 1 exit status
    CMakeFiles/ccls.dir/build.make:733: recipe for target 'ccls' failed
    make[2]: [ccls] Error 1
    CMakeFiles/Makefile2:136: recipe for target 'CMakeFiles/ccls.dir/all' failed
    [CMakeFiles/ccls.dir/all] Error 2
    Makefile:129: recipe for target 'all' failed
    make: * [all] Error 2
    kangyas@rpcs02: ~/env_build/ccls (master) $
    Dan Čermák
    ah, wait you're building the master branch?
    kangyampeta srinivas
    Should I build anything else? Which branch is recommended?
    George Xanthakis
    @MaskRay Some time ago I have been trying to build ccls on CentOS and you told me If I make it work to give you an update. So in order to make it work I built a newer gcc(9.1) and also built clang(10.0.0) and with some missing packages from the package manager the master branch ccls built successfully. So when I find some free time I am going to update the wiki on how to build ccls on Centos.
    kangyampeta srinivas
    Anything can be done to build ccls on debian without ncurses?
    Hi, there
    I am having trouble configuring ccls with coc.nvim
    I use Arch Linux, and installed ccls using "pacman -S ccls"
    Followed these instructions and tried first example: https://github.com/MaskRay/ccls/wiki/coc.nvim
      "diagnostic.infoSign": "--",
      "diagnostic.displayByAle": true,
      "typescript.showUnused": false,
      "javascript.showUnused": false,
      "languageserver": {
        "ccls": {
          "command": "ccls",
          "filetypes": ["c", "cpp", "cuda", "objc", "objcpp"],
          "rootPatterns": [".ccls-root", "compile_commands.json"],
          "initializationOptions": {
            "cache": {
              "directory": ".ccls-cache"
            "client": {
              "snippetSupport": true
            "completion": {
              "placeholder": true
    Here is my :CocConfig
    Am I doing everything correctly?
    After following these steps nothing seems to work
    I am facing the same issue as @nullpointer666
    :CocList services shows languageserver.ccls [init]. Should that [init] be [running]?
    @nullpointer666 what does your :CocList services show for ccls?
    Carlo Nucera

    hi, I'm experiencing problems in indexing, I get a lot of errors like:

    12:52:54 indexer1          indexer.cc:1340 E failed to index /path/nix/src/libutil/args.cc

    but, in the project root folder, I did make clean && bear make -j5, and I have a compile_commands.json. Could you point how I should debug this?

    @MaskRay ^
    Fangrui Song
    retrieve the clang command line and run it in the terminal https://github.com/MaskRay/ccls/wiki/Debugging
    Carlo Nucera
    sorry, I'm completely new on c++ tooling, this project is compiled with gcc, and I have a Makefile
    @the-shank [init
    Carlo Nucera
    does that mean that I should build ccls in debug mode @MaskRay
    probably cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=gcc is enough? Let me try
    Fangrui Song
    building ccls in debug mode can allow you to attach a debugger to the ccls process
    -G 'Unix Makefiles' can be omitted.
    Simon Pintarelli
    I'm using ccls with emacs, it seems that if I open a file located in a git worktree the root directory is wrongly determined. It takes the path to main git checkout. Is ccls computing the root directory or is that done by lsp-mode?
    Fangrui Song
    @simonpintarelli The root directory is computed by lsp-mode. emacs-ccls sets an advice: (advice-add 'lsp--suggest-project-root :before-until #'ccls--suggest-project-root)
    Simon Pintarelli
    Thank you.
    Hi there. I'm having a problem with ccls indexing of dependencies. I have generated compile commands for my project, including commands for header files, using cmake and compdb. I see all the header files of my project in my compile_commands file, as well as the header files I am using from other libraries that I depend on. I have added the include directions of these libraries in my .ccls located in my project root. Everything works inside files directly inside my project. If I go to the definition of a symbol located in a dependency header file, ccls creates a .ccls-cache in the include directory of my dependency. ccls is unable to give me completions and the ability to go-to-definition from within the external library header file, even though those symbols can be accessed from header files inside my project. I am assuming this is because there is no .ccls located in the external library directory that defines -I directives to find the appropriate header files. Is there any way to make ccls use my project .ccls for external libraries as well? Especially given that the external header file in question actually has all include directives and compile options defined in my project compile_commands.json
    Hi everyone, I've enabled ccls semantic highlighting on emacs, but it only updates when I save and write to a file. Is there a way to make it highlight as I'm typing?
    Hi, I’m having some trouble getting ccls working on a toy project in emacs. ccls reports being unable to find header files, but if I use lsp-find-definition on the includes, it goes to the files (for both local and system includes). Would be very grateful for any help, I have explained in more detail here: MaskRay/emacs-ccls#88.
    turns out this is just an instance of MaskRay/ccls#622
    Christian Maniewski
    I am using coc.nvim as well and for some reason it's not picking up .h files. Is there any way to debug ccls there to see an error message?
    Christian Maniewski
    I put %h -x c++-header into the .ccls file
    Well, using two separate lines like suggested here works: https://github.com/MaskRay/ccls/wiki/Project-Setup#h--hpp
    Hi, I'm using ccls and it doesn't find headers like iostream, cstdio, or cstdint. It says ccls: cannot open file '/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include/iostream': No such file or directory even though I set (setq ccls-args '( "-init='{\"clang\":{\"extraArgs\":[\"-isystem\", \"/Library/Developer/CommandLineTools/usr/include/c++/v1\"]}}'")) as recommended on https://github.com/MaskRay/ccls/issues/191#issuecomment-453809905 . I'm using macOS Catalina with llvm installed via Homebrew.
    @chmanie Did you managed to solve this problem? I have the same issue, ccls sees headers like iostream but it does not see headers from my project, it looks like it is related to fact that I have headers in hdr folder and source in src, when I move them out to one folder it works just fine. My .ccls config is similar to Example A but extended with header parsing, I have minimal example if needed
    Christian Maniewski
    @k-brk I think it's a different problem
    The headers are found for me but they were parsed as c headers
    Hi. I'm also trying to get emacs working; in this case, emacs on Mac, tramp mode, and remote on a Linux dev VM. When I open a remote file I see ccls starting, and it starts logging output (redirected to /tmp)
    10:15:37 stdin            pipeline.cc:552 V(2) receive RequestMessage: 2 initialize
    10:15:37 ccls           initialize.cc:274 I initialize in directory /u/drew/src/purity with uri file:///u/drew/src/purity
    10:15:37 ccls           initialize.cc:297 I initializationOptions: {"compilationDatabaseCommand":"","compilationDatabaseDirectory":"","cache":{"directory":".ccls-cache","format":"binary","hierarchicalPath":false,"retainInMemory":2},"capabilities":{"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"}","moreTriggerCharacter":[]},"foldingRangeProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}},"clang":{"excludeArgs":[],"extraArgs":[],"pathMappings":[],"resourceDir":""},"client":{"diagnosticsRelatedInformation":true,"hierarchicalDocumentSymbolSupport":true,"linkSupport":true,"snippetSupport":true},"codeLens":{"localVariables":true},"completion":{"caseSensitivity":2,"detailedLabel":true,"dropOldRequests":true,"duplicateOptional":true,"filterAndSort":true,"include":{"blacklist":[],"maxPathSize":30,"suffixWhitelist":[".h",".hpp",".hh",".inc"],"whitelist":[]},"maxNum":100,"placeholder":true},"diagnostics":{"blacklist":[],"onChange":1000,"onOpen":0,"onSave":0,"spellChecking":true,"whitelist":[]},"highlight":{"largeFileSize":2097152,"lsRanges":false,"blacklist":[],"whitelist":[]},"index":{"blacklist":[],"comments":2,"initialNoLinkage":false,"initialBlacklist":[],"initialWhitelist":[],"maxInitializerLines":5,"multiVersion":0,"multiVersionBlacklist":[],"multiVersionWhitelist":[],"name":{"suppressUnwrittenScope":false},"onChange":false,"parametersInDeclarations":true,"threads":0,"trackDependency":2,"whitelist":[]},"request":{"timeout":5000},"session":{"maxNum":10},"workspaceSymbol":{"caseSensitivity":1,"maxNum":1000,"sort":true},"xref":{"maxNum":2000}}
    10:15:37 ccls           initialize.cc:329 I use -resource-dir=/usr/local/clang/lib/clang/10.0.0
    10:15:37 ccls             pipeline.cc:817 V(2) respond to RequestMessage: 2
    A bunch of "load cache" messages, then the last one is
    10:15:46 ccls             pipeline.cc:474 I loaded project. Refresh semantic highlight for all working file.
    Then the process exits
    Stephen Robinson
    Is there a way to set the size of types in a cross compiling setup? In the arm setup I am using a uint32_t is supposed to be %ul, but ccls is giving me warnings. I think I have -target set properly.
    Rafał Sarnikowski
    I'm using ccls with coc.nvim and my .cu files are not being processed, cpp files in the same projects seems to be working, is there any way to force ccls to treat .cu files as .cpp files?
    Fangrui Song
    MaskRay/ccls#662 Support $/progress and WorkDoneProgress{Begin,Report,End}
    @arbernat https://github.com/MaskRay/ccls/wiki/Debugging#dump-lsp-requestsresponses To intercept early requests/responses, you can use a shell script wrapper
    exec strace -s999 -e read,write -o /tmp/strace.log -f path/to/ccls "$@"