简体   繁体   English

armeabi-v7a编译cpp文件的错误

[英]armeabi-v7a compiling error for cpp file

I am using getline function and compiling using ndk but i am getting error : 我使用getline函数并使用ndk编译,但我收到错误:

'getline' was not declared in this scope

is this error due to limitations of armeabi-v7a or due to glib?How can it be resolved for the same function. 这个错误是由于armeabi-v7a的限制还是由于glib?如何解决相同的功能?

I have already #define _GNU_SOURCE before <stdio.h>

In general, when you encounter such an error, you go to your NDK directory and user either Midnight Commander (Linux) or Far Manager (Windows, Linux+Wine) to search the files (file mask: *.h ) for your function, getline in this case. 通常,当您遇到此类错误时,您将转到NDK目录并使用Midnight Commander(Linux)或Far Manager(Windows,Linux + Wine)来搜索函数的文件(文件掩码: *.h ), getline在这种情况下。 You will get a screenful of search results, and it's up to you to #include the right file. 您将获得一系列搜索结果,您可以#include正确的文件。

Once in a while your function will not be found; 偶尔你的功能将无法找到; in this case you search the 'net for a place where you can borrow the source. 在这种情况下,您可以在'网上搜索可以借用来源的地方。

Sometimes the function in the code being ported has just no meaning, eg if the function reads a line from stdin but the program going to invoke it is not a command-line utility , there is a problem. 有时,被移植的代码中的函数没有任何意义,例如,如果函数从stdin读取一行但是要调用它的程序不是命令行实用程序 ,则存在问题。

Most likely, the source that you port #define -s switches for Linux, Mac (Darwin) and Windows, you have to choose the right configuration to derive the Android configuration from (and probably the Mac one will be the best). 最有可能的是,您为Linux,Mac(Darwin)和Windows移植#define -s交换机的源代码,您必须选择正确的配置来从中获取Android配置(可能Mac将是最好的)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM