您的位置:首页 > 运维架构

Windows下cscope:can't find the source file

2015-07-08 17:20 411 查看
在windows下使用cscope的时候遇到这样一个问题,使用

find  -name "*.c" -o -name "*.cpp" >> cscope.files


find命令使用的是Gunwin32 的find.exe

生成cscope.filse后使用

cscope -b


希望生成cscope.out文件

但是返回的却是

cscope : can’t find source file

身边正好有一台服务器,

在服务器上使用上诉命令却没有问题.

然后将在windows上的cscope.files拷贝到服务器张依然出现

cscope : can’t find source file

但是将服务器上的cscope.files拷贝到本地,

执行cscope -b却没有问题,成功生成 cscope.out

仔细比较两个cscope.files发现,windows下通过powershell生成的cscope.files是GBK格式,而服务器上为utf8;

期望的解决方法:

1.将powershell的编码格式改为utf8

2.使用powershll生成utf8格式的文件

第一中方法没有找到实现方式

第二种方法的实现如下:

find -name “.c” -o -name “.cpp” | set-content -encoding utf8 cscope.files
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vim