C/C++编译出现error: stray ‘\342’ in program

    昨天在写opencv的程序时,编译出现下面状况

                exbot@ubuntu:~/Downloads/opencv/opencv-2.4.9/samples/xcx$ ./build.sh
                camtest.cpp:44:1: error: stray ‘\342’ in program
                camtest.cpp:44:1: error: stray ‘\200’ in program
                camtest.cpp:44:1: error: stray ‘\235’ in program
                camtest.cpp:44:1: error: stray ‘\’ in program
                camtest.cpp:44:1: error: stray ‘\342’ in program
                camtest.cpp:44:1: error: stray ‘\200’ in program
                camtest.cpp:44:1: error: stray ‘\235’ in program


       错误原因:  程序中出现中文的  的引号   “ ”           应该改为英文引号   " "

Main.cc:37:17: error: stray ‘\342’ in program result =“Yes”; ^ Main.cc:37:18: error: stray ‘\200’ in program result =“Yes”; ^ Main.cc:37:19: error: stray ‘\234’ in program result =“Yes”; ^ Main.cc:37:23: error: stray ‘\342’ in program result =“Yes”; ^ Main.cc:37:24: error: stray ‘\200’ in program result =“Yes”; ^ Main.cc:37:25: error: stray ‘\235’ in program result =“Yes”; ^ Main.cc:39:17: error: stray ‘\342’ in program result =“No”; ^ Main.cc:39:18: error: stray ‘\200’ in program result =“No”; ^ Main.cc:39:19: error: stray ‘\234’ in program result =“No”; ^ Main.cc:39:22: error: stray ‘\342’ in program result =“No”; ^ Main.cc:39:23: error: stray ‘\200’ in program result =“No”; ^ Main.cc:39:24: error: stray ‘\235’ in program result =“No”; ^ Main.cc: In function ‘std::__cxx11::string solution(std::__cxx11::string, std::__cxx11::string)’: Main.cc:17:20: error: ‘strlen’ was not declared in this scope int tStrLenW = strlen(words); ^~~~~~ Main.cc:17:20: note: suggested alternative: ‘mbrlen’ int tStrLenW = strlen(words); ^~~~~~ mbrlen Main.cc:27:13: error: ‘strcat’ was not declared in this scope strcat(pCharText, &msg[tMsgFlag]); ^~~~~~ Main.cc:27:13: note: suggested alternative: ‘struct’ strcat(pCharText, &msg[tMsgFlag]); ^~~~~~ struct Main.cc:36:33: error: cannot convert ‘std::__cxx11::string {aka std::__cxx11::basic_string}’ to ‘const char*’ for argument ‘2’ to ‘int strcasecmp(const char*, const char*)’ if(strcasecmp(pCharText, msg) == 0) ^ Main.cc:37:20: error: ‘Yes’ was not declared in this scope result =“Yes”; ^~~ Main.cc:39:20: error: ‘No’ was not declared in this scope result =“No”; ^
06-06
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值