1 >------ Build started: Project: KuanLibTest, Configuration: Release Win32 ------
1 > Compiling...
1 > stdafx.cpp
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 21 ) : error C2039: ' div_t ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 21 ) : error C2873: ' div_t ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 21 ) : error C2039: ' ldiv_t ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 21 ) : error C2873: ' ldiv_t ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 23 ) : error C2039: ' abort ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 23 ) : error C2873: ' abort ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 23 ) : error C2039: ' abs ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 23 ) : error C2873: ' abs ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 24 ) : error C2039: ' atof ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 24 ) : error C2873: ' atof ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 24 ) : error C2039: ' atoi ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 24 ) : error C2873: ' atoi ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 24 ) : error C2039: ' atol ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 24 ) : error C2873: ' atol ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 25 ) : error C2039: ' bsearch ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 25 ) : error C2873: ' bsearch ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 25 ) : error C2039: ' calloc ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 25 ) : error C2873: ' calloc ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 25 ) : error C2039: ' div ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 25 ) : error C2873: ' div ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 26 ) : error C2039: ' exit ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 26 ) : error C2873: ' exit ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 26 ) : error C2039: ' free ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 26 ) : error C2873: ' free ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 26 ) : error C2039: ' getenv ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 26 ) : error C2873: ' getenv ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 27 ) : error C2039: ' labs ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 27 ) : error C2873: ' labs ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 27 ) : error C2039: ' ldiv ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 27 ) : error C2873: ' ldiv ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 27 ) : error C2039: ' malloc ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 27 ) : error C2873: ' malloc ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 28 ) : error C2039: ' mblen ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 28 ) : error C2873: ' mblen ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 28 ) : error C2039: ' mbstowcs ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 28 ) : error C2873: ' mbstowcs ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 28 ) : error C2039: ' mbtowc ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 28 ) : error C2873: ' mbtowc ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 29 ) : error C2039: ' qsort ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 29 ) : error C2873: ' qsort ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 29 ) : error C2039: ' rand ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 29 ) : error C2873: ' rand ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 29 ) : error C2039: ' realloc ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 29 ) : error C2873: ' realloc ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 30 ) : error C2039: ' srand ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 30 ) : error C2873: ' srand ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 30 ) : error C2039: ' strtod ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 30 ) : error C2873: ' strtod ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 30 ) : error C2039: ' strtol ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 30 ) : error C2873: ' strtol ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 31 ) : error C2039: ' strtoul ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 31 ) : error C2873: ' strtoul ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 31 ) : error C2039: ' system ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 31 ) : error C2873: ' system ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 32 ) : error C2039: ' wcstombs ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 32 ) : error C2873: ' wcstombs ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 32 ) : error C2039: ' wctomb ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstdlib( 32 ) : error C2873: ' wctomb ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 19 ) : error C2039: ' memchr ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 19 ) : error C2873: ' memchr ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 19 ) : error C2039: ' memcmp ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 19 ) : error C2873: ' memcmp ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 21 ) : error C2039: ' memset ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 21 ) : error C2873: ' memset ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 22 ) : error C2039: ' strcat ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 22 ) : error C2873: ' strcat ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 22 ) : error C2039: ' strchr ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 22 ) : error C2873: ' strchr ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 22 ) : error C2039: ' strcmp ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 22 ) : error C2873: ' strcmp ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 23 ) : error C2039: ' strcoll ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 23 ) : error C2873: ' strcoll ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 23 ) : error C2039: ' strcpy ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 23 ) : error C2873: ' strcpy ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 23 ) : error C2039: ' strcspn ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 23 ) : error C2873: ' strcspn ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 24 ) : error C2039: ' strerror ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 24 ) : error C2873: ' strerror ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 24 ) : error C2039: ' strlen ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 24 ) : error C2873: ' strlen ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 24 ) : error C2039: ' strncat ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 24 ) : error C2873: ' strncat ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 25 ) : error C2039: ' strncmp ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 25 ) : error C2873: ' strncmp ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 25 ) : error C2039: ' strncpy ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 25 ) : error C2873: ' strncpy ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 25 ) : error C2039: ' strpbrk ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 25 ) : error C2873: ' strpbrk ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 26 ) : error C2039: ' strrchr ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 26 ) : error C2873: ' strrchr ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 26 ) : error C2039: ' strspn ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 26 ) : error C2873: ' strspn ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 26 ) : error C2039: ' strstr ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 26 ) : error C2873: ' strstr ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 27 ) : error C2039: ' strtok ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 27 ) : error C2873: ' strtok ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 27 ) : error C2039: ' strxfrm ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\cstring( 27 ) : error C2873: ' strxfrm ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\exception( 208 ) : error C2039: ' set_terminate ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\exception( 208 ) : error C2873: ' set_terminate ' : symbol cannot be used in a using - declaration
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\exception( 208 ) : error C2039: ' terminate_handler ' : is not a member of ' `global namespace ''
1 > E:\Program Files\Microsoft Visual Studio 9.0 \VC\include\exception( 208 ) : fatal error C1003: error count exceeds 100 ; stopping compilation
1 > Build log was saved at " file://f:\Live Mesh\computer\Coding\fangyukuan\trunk\cpp\kuanlib_test\KuanLibTest\Release\BuildLog.htm "
1 > KuanLibTest - 102 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up - to - date, 0 skipped ==========
后来发现,是我把 #include <string> 放到命名空间里了。而string包含了cstdlib这个文件。所以里面的函数被限制到这个命名空间了。而其它地方用的时候,没有使用这个命名空间,导致上面的编译错误。这些只是我的推测。
我把#include <string>和其它包含路径移到命名空间外面,就编译通过了。
以后要记住:不要把包含的路径放到命名空间里。
当然如果是想把某个头文件里的定义限制在某个命名空间的时候,可以把包含听路径放到命名空间里。其实有时我解决命名冲突也用这种方法的。
本文地址:http://www.cnblogs.com/fangyukuan/archive/2010/06/17/1759757.html