Vim logo vim online Vim Book Ad

 Tip #338: vim + cscope + cygwin

 tip karma   Rating 28/10, Viewed by 1029 

created:   October 4, 2002 10:01      complexity:   intermediate
author:   Vijay Sampath      as of Vim:   5.7

Tip #292 doesn't seem to be true, at least not anymore. I am using cscope 15.4 and vim 6.1. With a few hacks, I was able to get cscope to work with vim under cygwin for Windows 2000. I did not need to change the sprintf line. The hacks included

1. Copying if_cscope.? to the src directory and the if_cscope.pro to the src/proto directory. These files do not come standard with the Windows source distribution of vim.  (I think it should - anybody in charge of distribution listening?)

2. Edit if_cscope.c to make the following changes:

Add the following includes:
    #include <sys/unistd.h>
    #include <sys/signal.h>

3. Edit Make_cyg.mak

Add if_cscope.o to OBJ variable.

Add a rule for this at the end

$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL)
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o

Uncomment the lines following

#>>>>> uncomment this block to build a GUI version


4. Edit feature.h

Force cscope compilation:

# define FEAT_CSCOPE

5. make -f Make_cyg.mak GUI=yes

6. Note that the env variable TMPDIR should be defined in VIM for cscope to work correctly.

That should do it. Somebody in charge of distribution please make this standard. It would save a lot of trouble.

 rate this tip  Life Changing Helpful Unfulfilling 

<<editing remote files via scp in vim | "tabbed windows" >>

Additional Notes

JavaCoder, October 4, 2002 10:57
Does anyone know if there's a cscope for Windows?  I'd surely love to use it directly under Windows (not in Cygwin).
perd, October 6, 2002 19:23
There is cscope for windows, but the problem doesn't lie in cscope, it lies in vim's integration with cscope.  It uses a few apis that are only available w/ cygwin.
JavaCoder, October 9, 2002 7:42
Where can I find cscope for windows?
Brian K, October 15, 2002 14:33
Another alternative is to install the XFree86 packages that are part of the Cygwin distribution (http://xfree86.cygwin.com/).  I installed that along with the WindowMaker window manager.  I then downloaded the vim Unix source and edited the src/Makefile.  I uncommented:

CONF_OPT_CSCOPE = --enable-cscope

and

CONF_OPT_GUI = --enable-gui=motif

I rebuilt vim and installed it to /usr/bin/vim.  I can now use cscope on Windows by running gvim (vim -g) in WindowMaker session.
Anonymous, October 25, 2002 15:00
Brian's way is actually even better.
Anonymous, November 1, 2002 8:37
There's a windows version of cscope here: http://www.geocities.com/shankara_c/cscope.html
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo