首页 > 移动平台 > 详细

iostream与iostream.h乱弹琴

时间:2014-07-14 17:01:42      阅读:386      评论:0      收藏:0      [点我收藏+]

#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

很幸运的出现了一下错误,bubuko.com,布布扣

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。

iostream与iostream.h乱弹琴,布布扣,bubuko.com

iostream与iostream.h乱弹琴

原文:http://blog.csdn.net/nanlus/article/details/37757503

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!