__system_property_get arm64 連結錯誤

來源:互聯網
上載者:User

標籤:ndk   arm64   property   

undefined reference to `__system_property_get’

這一系列的函數在arm64的標頭檔有定義,但是在libc.so中卻找不到實現。
header: sys/system_properties.h

__system_property_get__system_property_set__system_property_find__system_property_read__system_property_find_nth__system_property_foreach

編譯64位的arm平台的庫的時候報了一個這樣的連結錯誤,__system_property_get是Android NDK提供的一個函數,32位上一直都是ok的,編譯64的時候既然會報這個錯誤,readelf查看64位的libc.so確實找不到這個符號。於是Google發現了:
http://stackoverflow.com/questions/28413530/api-to-get-android-system-properties-is-removed-in-arm64-platforms

也在Google的issues中找到了這個bug
https://code.google.com/p/android/issues/detail?id=143627

解決辦法:
找到一台arm平台的Android 5.1的裝置或虛擬機器,把/system/lib64/libc.so取出替換NDK裡面的庫即可。

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

__system_property_get arm64 連結錯誤

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.