Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #338 - Vim and cscope and cygwin

Created: October 4, 2002 10:01 Complexity: intermediate Author: Vijay Sampath Version: 5.7 Karma: 182/52 Imported from: Tip#338

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.

Comments

Does anyone know if there's a cscope for Windows? I'd surely love to use it directly under Windows (not in Cygwin).

JavaCoder , October 4, 2002 10:57


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.

perd , October 6, 2002 19:23


Where can I find cscope for windows?

JavaCoder , October 9, 2002 7:42


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.

Brian K , October 15, 2002 14:33


Brian's way is actually even better.

Anonymous , October 25, 2002 15:00


There's a windows version of cscope here: http://www.geocities.com/shankara_c/cscope.html

Anonymous , November 1, 2002 8:37


Brian's note is quite clear. Its the best. Just one needs to install the Xfree86 packages by using the Cygwin's generic setup.exe. Once done just start the window maker command by using startx and proceed further. If anyone has confusion please mail me at the above mentioned address and I shall try to help out. Dont break your head for long. Better ask.!!!!

S.Md.Kabeer Ahmed, smdahmed--AT--linuxquestions.net , April 24, 2004 10:42


I just followed Brian's way by uncommenting CONF_OPT_CSCOPE = --enable-cscope. Cscope does work with vim under cygwin, but it take almost half a minute to start up vim

Vincent , October 18, 2005 2:06


I just downloaded the tarball from http://cscope.sourceforge.net and didn't have to do anything special to get cscope + vim + cygwin working. Also cygwin now comes with mlcscope as a package.

Anonymous , January 20, 2007 8:41


Advertisement