日期:2014-05-16  浏览次数:20595 次

使用ndk或linux下独立交叉编译(ffmpeg)

1、ndk 编译程序

  • 在NDK的apps目录下创建helloworld目录,并且创建相关文件,目录结构如下:

helloworld

–Application.mk

–project

?? –jni

????? –Android.mk

????? –helloworld.c

Application.mk:

  1. APP_PROJECT_PATH := $(call my-dir)/project??
  2. ??
  3. APP_MODULES?????? := helloworld??

Android.mk:

view plaincopy to clipboardprint?
  1. LOCAL_PATH := $(call my-dir)??
  2. ??
  3. include $(CLEAR_VARS)??
  4. ??
  5. LOCAL_MODULE???? := helloworld??
  6. LOCAL_SRC_FILES := helloworld.c??
  7. ??
  8. #include $(BUILD_SHARED_LIBRARY)//编译动态库??
  9. include $(BUILD_EXECUTABLE)//编译可执行程序??

helloworld.c

view plaincopy to clipboardprint?
  1. #include<stdio.h>??
  2. ??
  3. int?main(int?argc,?char?*argv[])??
  4. {??
  5. ?? printf(