Troubleshooting of cs1_q errors in Windows

Source: Internet
Author: User
Solution to cs1_q option error in Windows from: http://easwy.com/blog/archives/cscope_sort_option_on_windows/

In the past, some netizens posted messages. When using cssag in windows, the following message is displayed using the-Q option:

D:\Temp> cscope -RbkqInput file specified two times.cscope: cannot create inverted index; ignoring -q optioncscope: removed files ncscope.in.out and ncscope.po.out 

At that time, easwy thought that cssag of Windows does not support the-Q option.

However, Liang Feng left a message yesterday saying:

In Windows, cssag supports the-Q option. The above error occurs because the appropriate sort command is not found. Therefore, you only need the GNU version of sort in the working directory of the cssag process. Note that the working directory of the process is not the directory of the executable program. Take a look at the cssag code snippet for specific reasons. Build. C # ifdef win32snprintf (sortcommand, sizeof (sortcommand), "Set lc_all = C & sort-T % S % s", tmpdir, temp1); # elsesnprintf (sortcommand, sizeof (sortcommand), "env lc_all = C sort-T % S % s", tmpdir, temp1); # endif

So I tried again. After cygwin is installed, csflood is used on the shell interface of cygwin. The error message above is not displayed. If you open windows command line cmd.exe and execute cs.pdf in it, the above error will occur.

After a thorough comparison of cygwinand Microsoft Excel, I found that it was originally a ghost of Windows sort.exe.

In the shellwindow of cygwin, the setting of pathcontext changes will first find the gnuversion sort.exe, so the above cssag command can be successfully executed. However, in the "cmd.exe" window, pathcontext changes will first find sort.exe instead of GNU sort.exe, so the above error message will appear.

. The example program is as follows:

D:\Temp> type cs.bat@echo offset path=c:\cygwin\bin;cscope -Rbkq 

In this batch, first point the path environment variableC: \ cygwin \ bin;, Both my cscope.exeand gnuversion sort.exe are in this directory. Now, the cscopecommand is executed. Now, the upgraded gnuversion sort.exe is used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.