How to integrate cscope with vim on Windows?

gudge picture gudge · Mar 14, 2012 · Viewed 9k times · Source

vim version : 7.1 echo has ('cscope') : 1

I am trying to integrate cscope environment with vim on windows. I am trying to create a new database through the following command

cscope add C:\Path

I get the error message E563: stat(C:\Path) error:2

I assume the error message is because cscope is unable to create the database file needed by it to perform it's operations. The path provided is a valid path.

What could be the possible reason for the following error ?

Thanks Gudge

Answer

keltor picture keltor · Mar 14, 2012

Just to validate how you set it up ...

  1. Create the cscope database:

    C:\Tools\src>c:\tools\bin\cscope.exe -bv .*.c .*.h

    Generating Database ...

  2. Next you need to set the path to the cscope executible inside vim:

    se csprg=C:\tools\bin\csope.exe

  3. Then add the path (properly escaped) to your cscope database:

    cs add C:\tools\src\

  4. Now you should be able to use cscope just fine.

Note that I used vim 7.3.470 from the Cream site and my cscope is the native Win32 version hosted at Google code.