Friday, October 7, 2011

Solution: E567: no cscope connections

If you are getting this error:
E567: no cscope connections

It could be because of multiple reasons. A couple of things to check are:

1. In your .vimrc file check if you are pointing the csprg variable to the correct location of cscope.
In mine, I had to point it to /usr/bin/cscope. You can find this location by running the command
which cscope.

2. If the editor could find cscope, then you need to also ensure that it is able to access the cscope.out files which form the cscope database. If you are invoking vim from a directory that does not contain this file then you will still see the no connections error. One alternative is to start the vi editor from the place where you have the cscope.out file. Note that the cscope.out file is generated when you run the cscope -R command at least once - this is used to build the csope database. To remedy this solution, export the variable export CSCOPE_DB="/path/to/cscope.
out" in your .bashrc file. You will need to reload the .bashrc by running the command source .bashrc from your home directory.

These two things did the trick for me. I hope it works for you too, since cscope is awesome!


Post a Comment