Vim logo vim online Vim Book Ad

 Tip #292: vim + cscope + cygwin

 tip karma   Rating 8/2, Viewed by 773 

created:   July 30, 2002 4:54      complexity:   intermediate
author:   Giorgio Marzano      as of Vim:   6.0

I've found that vim + cscope + cygwin does not work. The problem seems to be that in

sprintf(cmd, "exec %s -dl -f %s", prog, csinfo[i].fname);

vim execs cscope with the "-dl" options, causing it to fail. It is probably a cscope bug, but a simple workaround is top build vim without thad "d":

sprintf(cmd, "exec %s -l -f %s", prog, csinfo[i].fname);

seems to work for me!

 rate this tip  Life Changing Helpful Unfulfilling 

<<^P & auto filling of variables and text | remember where you had ended reading help >>

Additional Notes

[email protected], October 4, 2002 9:59
This (keyword #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.
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