emacs-lsp / emacs-ccls

Emacs client for ccls, a C/C++ language server
200 stars 29 forks source link

ccls exits instantly (with code 53) #44

Closed ItsHoff closed 5 years ago

ItsHoff commented 5 years ago

When I try to open a c++ file with lsp-mode enabled I get:

LSP :: Connected to [ccls:10976 status:starting].
LSP :: ccls has exited (exited abnormally with code 53)
Server ccls:10976 status:starting exited with status exit. Do you want to restart it? (y or n) y
LSP :: Restarting LSP in buffer resource_manager.cpp
LSP :: Connected to [ccls:11592 status:starting].
LSP :: ccls has exited (exited abnormally with code 53)
Server ccls:11592 status:starting exited with status exit. Do you want to restart it? (y or n)

and only Process ccls stderr finished is printed to *ccls::stderr*. However, ccls does index the project when run from the command line ../ccls/build/ccls.exe -index=.

System Information:

MaskRay commented 5 years ago

Check if ccls-executable (default: "ccls") is absolute or can be found in your $PATH.

ItsHoff commented 5 years ago

I'm using an absolute path and I'm pretty sure emacs is able to find the ccls executable, since with an invalid path lsp-mode throws an error Command "C:/invalid/path/to/ccls.exe" is not present on the path.

LanternD commented 4 years ago

Same error code, same behavior. The path is absolute, which didn't resolve this problem.

Btw, if I use the ccls compiled by Visual Studio, the error code was 116. If it is compiled by msys2-64, the error code was 53.

LanternD commented 4 years ago

I saw this comment and gave it a try. In cmd.exe, I just ran ccls -h. Then the program prompted 4 errors, saying missing the following dlls:

I found all of them in the msys64\mingw64\bin, and copied them all to the Release\ccls.exe folder. Now the ccls can work normally.

And interestingly, I could not reproduce the exit code 116 anymore after I applied these changes. Notice that I didn't modify the ccls folder compiled by the Visual Studio. No idea why.