0

I am just testing the LSP-ccls in Emacs. Emacs gave me this mysterious error, but the code is indeed runnable. Does anyone know why this is happening?

#include <iostream>
using namespace std;

int main() {
  for (auto i = 0; i < 5; i++) {
    cout << i << endl;
  }
  return 0;
}

Error on line 6, endl:

reference to overloaded function could not be resolved; did you mean to call it?

This is the screenshot about what's happening

My emacs configuration is

 (use-package ccls
   :ensure t
   :config
   (setq ccls-executable "ccls")
   (setq lsp-prefer-flymake nil)
   (setq-default flycheck-disabled-checkers '(c/c++-clang c/c++-cppcheck c/c++-gcc))
   :hook ((c-mode c++-mode objc-mode) .
     (lambda () (require 'ccls) (lsp-deferred))))
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
yaoya
  • 1
  • 1
  • 2
    Have you tried another language server? That's an error from the server, not from the emacs side - I know Apple clang supports obj-c, so you might have better luck with clangd (which is a phenomenal language server). – osuka_ Sep 17 '21 at 03:52
  • Thanks, Osuka. I took your advice and also tried clangd, but the same problem preserves. But I really appreciate your help! :) – yaoya Sep 18 '21 at 17:58

0 Answers0