Include header path change from Windows to Linux

前端 未结 6 963
终归单人心
终归单人心 2020-12-10 05:08

I\'m porting an application written in C++ from Windows to Linux. I have a problem with the header files path. Windows uses \\ and Linux uses /. I

6条回答
  •  攒了一身酷
    2020-12-10 06:13

    You can try this command based on previous perl command which do the work recusrively

    find .  -type f -name \* | xargs grep '#include' | grep '\\' |awk -F: '{print $1}'|sort| uniq | xargs -n1 perl -i.bak -pe 'tr!\\!/! if /^\s*#\s*include\b/'
    

提交回复
热议问题