iostream与iostream.h乱弹琴

#include <iostream.h> 非标准输出流

#include <iostream>    标准输出流


见短eclipse关于使用android ndk时的简单代码。hello.cpp

#include <jni.h>
#include <iostream.h>
#include <string.h>
#include <stdio.h>

using namespace std;

int main() {

	std::string s = "string";

	printf("printf\n");

	std::cout << "cout" << std::endl;

	return 0;
}


Application.mk中,是这么写的

APP_ABI := armeabi
APP_STL := stlport_static

非常幸运的出现了一下错误。大笑

postypes.h:230:16: error: 'mbstate_t' was not declared in this scope ...

...

ios:5:7: error: '_STLP_NEW_IO_NAMESPACE' has not been declared...

...


如今该怎么解决呢?

#include <iostream.h>          ->      #include <iostream>

APP_STL := stlport_static     ->     APP_STL := gnustl_static




“.h”非标准的。C的标准库函数,无".h"的,须要用命名空间,是C++的。

其他人是不是在所有的差异,实例math。

版权声明:本文博主原创文章。博客,未经同意不得转载。

posted @ 2015-09-21 17:26  lcchuguo  阅读(214)  评论(0编辑  收藏  举报