2013年3月22日 星期五

have error when build mini_httpd : previous declaration of ‘getline’ was here

mini_httpd官網

編譯mini_httpd

  1. wget http://www.acme.com/software/mini_httpd/mini_httpd-1.19.tar.gz
  2. tar zxvf mini_httpd-1.19.tar.gz
  3. cd mini_httpd-1.19/
  4. make
出現錯誤
htpasswd.c:52: error: conflicting types for ‘getline’
/usr/include/stdio.h:651: note: previous declaration of ‘getline’ was here
htpasswd.c: In function ‘add_password’:
htpasswd.c:117: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
htpasswd.c: In function ‘main’:
htpasswd.c:216: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
make: *** [htpasswd.o] Error 1

htpasswd.c第52行所宣告的名字getline與/usr/include/stdio.h +651命名相同
以下是/usr/include/stdio.h部分內容
/* Like `getdelim', but reads up to a newline.

   This function is not part of POSIX and therefore no official
   cancellation point.  But due to similarity with an POSIX interface
   or due to the implementation it is a cancellation point and
   therefore not marked with __THROW.  */
extern _IO_ssize_t getline (char **__restrict __lineptr,
                size_t *__restrict __n,
                FILE *__restrict __stream) __wur;
#endif

修改方式將htpasswd.c第52行函數命名方式修改 from getline to getlinexxx
另外第192行也需要修改

重新編譯
make clean
make
OK

最後訊息
gcc -O   -c match.c
gcc -O   -c tdate_parse.c
gcc -O   -s mini_httpd.o match.o tdate_parse.o   -lcrypt -o mini_httpd
gcc -O   -c htpasswd.c
htpasswd.c: In function ‘add_password’:
htpasswd.c:117: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
htpasswd.c: In function ‘main’:
htpasswd.c:216: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
gcc -O   -s htpasswd.o -lcrypt -o htpasswd




透過Facebook分享

2013年3月20日 星期三

eclipse無法識別小米2

這篇提供解決方法

1. 安裝驅動程式 (按照小米手機內建教學就可以正確安裝)
2. 撥號介面下輸入以下密碼 *#*#717717#*#*

就可以識別到xiaomi手機



透過Facebook分享

2013年3月8日 星期五

Mac下使用wget下載檔案的替代方式

使用curl -O

curl -O http://www.acme.com/software/mini_httpd/mini_httpd-1.19.tar.gz

透過Facebook分享

2013年2月27日 星期三

iOS 6 越獄 JB

1. 使用evasiOn官網所放出的jb工具
相關安裝說明
http://www.mobile01.com/topicdetail.php?f=591&t=3180922

2. 需要安裝"測試用" App前需要安裝AppSync
於Cydia內加入以下軟體源 "repo.hackyouriphone.org"
搜尋 AppSync for iOS 6

3. 測試用app哪裡找
Installous已經功臣身退嚕
可以考慮iFanBox (http://www.ifanbox.cn/)

Ref:

http://i.sj.91.com/content/2013-02-18/20130218183235584.shtml
http://www.ifanbox.cn/

透過Facebook分享

2012年7月10日 星期二

iPhone 4S如何刪除歌曲

Mac OS X : 10.7.4

iPhone 4s: iOS 5.1

最近因為歌曲太多(才6.xG有很多嗎)
把iTunes上的一些專輯刪除後,接上iPhone4s卻無法將PC上的歌曲同步到iPhone 4s
換句話說,iPhone 4S上的歌曲並沒有減少。

使用以下方法
1. iPhone 4s點選"設定"->"一般"->"用量"->"音樂"->"編輯"
點擊-
點擊"刪除"

2. PC上iTunes進行歌曲同步

透過Facebook分享