2012-07-15 63 views
0

我試圖編譯我的插座lib中的NDK和我得到以下兩個錯誤:的Android NDK問題插座和性病問題

error: 'close' was not declared in this scope 

error: 'min' is not a member of 'std' 

我按照步驟概述HERE修復後者無濟於事,我不確定第一個。伊夫進口下列庫:

#include <sys/socket.h> 
#include <sys/types.h> 
#include <netinet/in.h> 
#include <arpa/inet.h> 
#include <netinet/tcp.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <sys/ioctl.h> 

誰能幫助我?我正在慢慢失去理智。我修復的每個構建錯誤似乎都出現了。我很接近得到這個工作.....

此外,我已閱讀相關的ndk文檔。我已經在我的Application.mk文件中嘗試了gnustl_shared和stlport_shared作爲APP_STL:值。

只是作爲參考,你可以得到源代碼HERE

回答

2

std::min需要#include <algorithm>close要求#include <unistd.h>

當你得到這樣的錯誤時,檢查該函數的文檔並查看它需要的頭文件。

+0

我已閱讀文檔。我可能沒有閱讀docs/dir中的正確文檔,但是... 無論哪種情況,感謝!!!!!你是我的英雄!像魅力一樣工作。 – nterry 2012-07-16 01:23:06