Windows下cscope:can't find the source file

在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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章