如何租用网站服务器,外国字体网站,如果搭建网站,icp备案号是什么意思http://blog.sina.com.cn/s/blog_79d599dc0100r2vz.html昨天一同事把代码准备重新全新布置到新的环境上去的时候#xff0c;代码报错了#xff0c;先开始报错如下#xff1a;error: ‘memset’ was not declared in this scopeerror: ‘strcat’ was not declared in this s…http://blog.sina.com.cn/s/blog_79d599dc0100r2vz.html昨天一同事把代码准备重新全新布置到新的环境上去的时候代码报错了先开始报错如下error: ‘memset’ was not declared in this scopeerror: ‘strcat’ was not declared in this scope首先想到的肯定是头文件未包含进来。但不可能因为这套代码已经在其它环境上编译过N次啦不可能代码里面没有添加对头文件的包含啊。于是想到是否是因为新环境里面include目录下没有对应的头文件呢还或是include目录在这个环境下变了呢不是/usr/include下面啦。经过一查上面两个都不是。这个时候就有点郁闷啦。把环境按以前的都设置一遍还是一样。没办法啦。只好放今天来重新查查啦。今天早上来可能时间也比较充足所以慢慢来。既然报这个错误那我把这个头文件再添加到.h代码里面呢然后发现添加一个某个错误就能编译过去。看来还真是头文件的问题。但接下来还有其他几个警告如下test.cpp:213: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_resulttest.cpp: In member function ‘int test::load(std::string)’:test.cpp:58: warning: deprecated conversion from string constant to ‘char*’test.cpp:58: warning: deprecated conversion from string constant to ‘char*’test.cpp:58: warning: deprecated conversion from string constant to ‘char*’test.cpp:58: warning: deprecated conversion from string constant to ‘char*’test.cpp:58: warning: deprecated conversion from string constant to ‘char*’test.cpp:94: warning: suggest explicit braces to avoid ambiguous ‘else’test.cpp:61: warning: ignoring return value of ‘int pipe(int*)’, declared with attribute warn_unused_result居然这些还报一一为这些没有判断函数返回值的作了修改。编译通过。然后就想为什么这个系统要求这么严格呢查一下GCC的版本如下以前旧环境gcc 版本 4.1.2 20070626 (Red Hat 4.1.2-14)现在的新环境gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)原来是GCC版本不同。所以想GCC新版本对代码的这些要求现在越来越严格啦。还有函数的一些检查项还有编译时候MAKEFILE里面对库文件的引用。具体是否是因为这个严格的原因没有去详细查GCC的文档。但猜想是这样吧。以后如果代码里面对某个函数的头文件还是尽量包含进来吧至少不是什么坏事。