内置函数警告不兼容的隐式声明使用NDK与LAME [英] Incompatible Implicit Declaration of Built-In Function Warning Using NDK with LAME

查看:582
本文介绍了内置函数警告不兼容的隐式声明使用NDK与LAME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想请遵循以下位置的教程

<一个href=\"http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI\" rel=\"nofollow\">http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI

这样做的依据是,它允许人们使用LAME MP3带JNI codeR。

我跟每个教程中提到的步骤。我的项目是位于

  C:\\工作区\\

和被称为LAME_Test。每本教程中标记的编辑与NDK 一节,我继续,并提出了所谓的'Android.mk'作为封闭本文下面的Makefile。

我是一个64位计算机上运行Windows 7。我已经安装了Cygwin和NDK,并测试了我的设置工作是在这个我工作的另一个项目。然而,当我去

  / cygdrive / C /工作区/ LAME_Test / JNI

在Cygwin并发出以下命令

  / cygdrive / C / Android版/ Android的NDK-R8B / NDK的构建

鉴于NDK位于

  C:\\ Android的\\ Android的NDK-R8B

编译吐出了一堆这样的警告

 警告:内建函数memset的不兼容的隐式声明[默认启用]

我在这个岗位的底部封闭警告的小片段(因为警告列表是​​非常大的,可能只是添加混乱 - 而不是增加值)。

想知道是否有解决这些警告,并得到一个不错的,干净的,编译一个漂亮的方式。

P.S:我要补充一点,我是能够建立+运行在上面(LAME4Android)的链接示例项目。这需要本土code的汇编。因此,它看起来像这个项目呢,其实,尽管所有的警告,罚款打造的 的。我最初还以为是因为警告打破。然而,这确实是真的很棒,如果有一些方法来解决这个警告。

Android.mk文件的内容

  LOCAL_PATH:= $(叫我-DIR)    包括$(CLEAR_VARS)    LOCAL_MODULE:=了libmp3lame
    LOCAL_SRC_FILES:= \\
    ./libmp3lame/bitstream.c \\
    ./libmp3lame/en$c$cr.c \\
    ./libmp3lame/fft.c \\
    ./libmp3lame/gain_analysis.c \\
    ./libmp3lame/id3tag.c \\
    ./libmp3lame/lame.c \\
    ./libmp3lame/mpglib_interface.c \\
    ./libmp3lame/newmdct.c \\
    ./libmp3lame/$p$psets.c \\
    ./libmp3lame/psymodel.c \\
    ./libmp3lame/quantize.c \\
    ./libmp3lame/quantize_pvt.c \\
    ./libmp3lame/reservoir.c \\
    ./libmp3lame/set_get.c \\
    ./libmp3lame/tables.c \\
    ./libmp3lame/takehiro.c \\
    ./libmp3lame/util.c \\
    ./libmp3lame/vbrqua​​ntize.c \\
    ./libmp3lame/VbrTag.c \\
    ./libmp3lame/version.c    LOCAL_LDLIBS:= -llog    包括$(BUILD_SHARED_LIBRARY)

内置函数警告的不兼容的隐式声明的登录

  $ / cygdrive / C / Android版/ Android的NDK-R8B / NDK的构建
Cygwin的:产生依赖的文件转换器脚本
编译大拇指:mp3lame&LT; = bitstream.c
编译大拇指:mp3lame&LT; = EN coder.c
C:/工作区/ LAME_Test / JNI /./了libmp3lame / EN coder.c:在函数'lame_en code_frame_init:
C:/工作区/ LAME_Test / JNI /./了libmp3lame / EN coder.c:202:9:警告:内建函数memset的不兼容的隐式声明[默认启用]
C:/工作区/ LAME_Test / JNI /./了libmp3lame / EN coder.c:在函数'lame_en code_mp3_frame:
C:/工作区/ LAME_Test / JNI /./了libmp3lame / EN coder.c:471:17:警告:内建函数'BCOPY不兼容的隐式声明[默认启用]
编译大拇指:mp3lame&LT; = fft.c
编译大拇指:mp3lame&LT; = gain_analysis.c
等等...


解决方案

很多搜索它的后看起来就像我一直在寻找在这里找到了答案

<一个href=\"http://stackoverflow.com/questions/8632835/lame-mp3-en$c$cr-compile-for-android/8632948#8632948\">Lame MP3恩codeR编译的Andr​​oid

对我来说,关键是要确保下面的行加入到我的Andr​​oid.mk文件

  LOCAL_CFLAGS = -DSTDC_HEADERS

由詹姆斯·张所说

我在下面附上这篇文章我说有啥我的完整的makefile是完全清楚的。

更新Android.mk文件的内容

  LOCAL_PATH:= $(叫我-DIR)    包括$(CLEAR_VARS)    LOCAL_MODULE:=了libmp3lame
    LOCAL_SRC_FILES:= \\
    ./libmp3lame/bitstream.c \\
    ./libmp3lame/en$c$cr.c \\
    ./libmp3lame/fft.c \\
    ./libmp3lame/gain_analysis.c \\
    ./libmp3lame/id3tag.c \\
    ./libmp3lame/lame.c \\
    ./libmp3lame/mpglib_interface.c \\
    ./libmp3lame/newmdct.c \\
    ./libmp3lame/$p$psets.c \\
    ./libmp3lame/psymodel.c \\
    ./libmp3lame/quantize.c \\
    ./libmp3lame/quantize_pvt.c \\
    ./libmp3lame/reservoir.c \\
    ./libmp3lame/set_get.c \\
    ./libmp3lame/tables.c \\
    ./libmp3lame/takehiro.c \\
    ./libmp3lame/util.c \\
    ./libmp3lame/vbrqua​​ntize.c \\
    ./libmp3lame/VbrTag.c \\
    ./libmp3lame/version.c    LOCAL_LDLIBS:= -llog
    LOCAL_CFLAGS = -DSTDC_HEADERS    包括$(BUILD_SHARED_LIBRARY)

I'm trying to follow the tutorial located at the following location

http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI

The gist of this is that it allows one to use the LAME MP3 encoder with JNI.

I followed each of the steps mentioned in the tutorial. My project is located at

C:\workspace\

and is called 'LAME_Test'. Per the section labeled Compilation with NDK in the tutorial, I went ahead and made a makefile called 'Android.mk' as is enclosed below this post.

I'm running Windows 7 on a 64-bit machine. I do have Cygwin and NDK installed and have tested that my setup works on another project that I'm working on. However, when I go to

/cygdrive/c/workspace/LAME_Test/jni

on Cygwin and issue the following command

 /cygdrive/c/Android/android-ndk-r8b/ndk-build

given that the NDK is located at

C:\Android\android-ndk-r8b

the compilation spits out a bunch of warnings like these

warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]                                                                                                   

I'm enclosing a small snippet of the warnings at the bottom of this post (because the list of warnings is really big and may just add clutter - rather than add value).

Was wondering if there's a slick way to resolve these warnings and get a nice, clean, compile.

P.S: I will add that I was able to build + run the sample project in the link above (LAME4Android). This required the compilation of the native code. So, it looks like the the project does, in fact, build fine despite all the warnings. I initially thought it was broken because of the warnings. However, it would indeed be really great if there were some way to fix the warnings.

Contents of Android.mk File

LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE        := libmp3lame
    LOCAL_SRC_FILES     := \
    ./libmp3lame/bitstream.c \
    ./libmp3lame/encoder.c \
    ./libmp3lame/fft.c \
    ./libmp3lame/gain_analysis.c \
    ./libmp3lame/id3tag.c \
    ./libmp3lame/lame.c \
    ./libmp3lame/mpglib_interface.c \
    ./libmp3lame/newmdct.c \
    ./libmp3lame/presets.c \
    ./libmp3lame/psymodel.c \
    ./libmp3lame/quantize.c \
    ./libmp3lame/quantize_pvt.c \
    ./libmp3lame/reservoir.c \
    ./libmp3lame/set_get.c \
    ./libmp3lame/tables.c \
    ./libmp3lame/takehiro.c \
    ./libmp3lame/util.c \
    ./libmp3lame/vbrquantize.c \
    ./libmp3lame/VbrTag.c \
    ./libmp3lame/version.c

    LOCAL_LDLIBS := -llog

    include $(BUILD_SHARED_LIBRARY)

Log of Incompatible Implicit Declaration of Built-In Function Warnings

$ /cygdrive/c/Android/android-ndk-r8b/ndk-build
Cygwin         : Generating dependency file converter script
Compile thumb  : mp3lame <= bitstream.c
Compile thumb  : mp3lame <= encoder.c
C:/workspace/LAME_Test/jni/./libmp3lame/encoder.c: In function 'lame_encode_frame_init':
C:/workspace/LAME_Test/jni/./libmp3lame/encoder.c:202:9: warning: incompatible implicit declaration of built-in function 'memset' [enabled by default]                                                                                                 
C:/workspace/LAME_Test/jni/./libmp3lame/encoder.c: In function 'lame_encode_mp3_frame':
C:/workspace/LAME_Test/jni/./libmp3lame/encoder.c:471:17: warning: incompatible implicit declaration of built-in function 'bcopy' [enabled by default]                                                                                                    
Compile thumb  : mp3lame <= fft.c
Compile thumb  : mp3lame <= gain_analysis.c
and so on...

解决方案

After a lot of searching it looks like the answer I was looking for was found here

Lame MP3 Encoder compile for Android

The key for me was to ensure that the following line was added to my Android.mk file

LOCAL_CFLAGS = -DSTDC_HEADERS

as mentioned by James Zhang.

I'm enclosing my complete makefile below this post so what I'm saying is perfectly clear.

Contents of Updated Android.mk File

LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE        := libmp3lame
    LOCAL_SRC_FILES     := \
    ./libmp3lame/bitstream.c \
    ./libmp3lame/encoder.c \
    ./libmp3lame/fft.c \
    ./libmp3lame/gain_analysis.c \
    ./libmp3lame/id3tag.c \
    ./libmp3lame/lame.c \
    ./libmp3lame/mpglib_interface.c \
    ./libmp3lame/newmdct.c \
    ./libmp3lame/presets.c \
    ./libmp3lame/psymodel.c \
    ./libmp3lame/quantize.c \
    ./libmp3lame/quantize_pvt.c \
    ./libmp3lame/reservoir.c \
    ./libmp3lame/set_get.c \
    ./libmp3lame/tables.c \
    ./libmp3lame/takehiro.c \
    ./libmp3lame/util.c \
    ./libmp3lame/vbrquantize.c \
    ./libmp3lame/VbrTag.c \
    ./libmp3lame/version.c 

    LOCAL_LDLIBS := -llog
    LOCAL_CFLAGS = -DSTDC_HEADERS

    include $(BUILD_SHARED_LIBRARY)

这篇关于内置函数警告不兼容的隐式声明使用NDK与LAME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆