Windows下cscope:can't find the source file

来源:互联网 发布:aotudesk是什么软件 编辑:程序博客网 时间:2024/06/01 08:38

在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

0 0
原创粉丝点击