編譯Android驅動對應的C測試程式出錯的解決方案以及正確流程

來源:互聯網
上載者:User

編寫好驅動之後,另外寫了個C程式來測試驅動,但是在編譯的時候,出現了如下的錯誤:[plain]  build/core/base_rules.mk:166: *** frameworks/base/opengl/libs: MODULE.TARGET.ETC.egl.cfg already defined by development/tools/emulator/opengl/system/egl。 停止。   這裡的意思是:frameworks/base/opengl/libs目錄已經在development/tools/emulator/opengl/system/egl定義了。 解決方案就是把frameworks/base/opengl/路徑下的 libs 目錄刪除即可。 編譯這個C驅動測試程式需要注意:1、程式放在 (你的android源碼目錄)/external/ 下面2、Android.mk 和對應的程式C檔案必須存在,最好放在同一級目錄下面3、編譯的時候,回到 你的android源碼目錄下面,使用 make 你的項目名稱進行編譯 範例:1、在~/workspace/android-4.0.4_r1.2/external/yapp/目錄下建立 helloapp目錄2、在helloapp目錄下建立對應的helloapp.c檔案3、在helloapp目錄下建立唯一的Android.mk檔案4、回到~/workspace/android-4.0.4_r1.2/目錄,使用make helloapp命令進行編譯5、編譯成功後,類似下面:[plain]  Install: out/target/product/generic/system/lib/libstdc++.so  Notice file: bionic/libm/NOTICE -- out/target/product/generic/obj/NOTICE_FILES/src//system/lib/libm.so.txt  Install: out/target/product/generic/system/lib/libm.so  Install: out/target/product/generic/system/bin/helloapp   到此,驅動的測試程式編譯完畢。 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.