2017-06-20 13 views
1

Windows用Android Studioを使用してAndroid用GStreamerを設定しようとしています。私はほとんど彼らのsiteからチュートリアルに続き、this(さらに私が助けてくれるものを見つけることができます)を見ています。私が手:Android NDKリンカー(GStreamer) - 無効なリンカー名-fuse-ld = gold

エラー:エラー: '-fuse-LD =金'

マイAndroid.mk引数に無効なリンカ名:

LOCAL_PATH := $(call my-dir) 
 

 
include $(CLEAR_VARS) 
 

 
LOCAL_MODULE := app 
 
LOCAL_SRC_FILES := app-1.c 
 
LOCAL_SHARED_LIBRARIES := gstreamer_android 
 
LOCAL_LDLIBS := -landroid 
 

 
include $(BUILD_SHARED_LIBRARY) 
 

 
ifndef GSTREAMER_ROOT 
 
ifndef GSTREAMER_ROOT_ANDROID 
 
$(error GSTREAMER_ROOT_ANDROID is not defined!) 
 
endif 
 
GSTREAMER_ROOT   := $(GSTREAMER_ROOT_ANDROID) 
 
endif 
 

 
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_ROOT)\share\gst-android\ndk-build 
 
GSTREAMER_PLUGINS   := coreelements ogg theora vorbis videoconvert audioconvert audioresample playback glimagesink soup opensles 
 
G_IO_MODULES    := gnutls 
 
GSTREAMER_EXTRA_DEPS  := gstreamer-video-1.0 
 

 
include $(GSTREAMER_NDK_BUILD_PATH)\gstreamer-1.0.mk

とアプリ/ build.gradle:

apply plugin: 'com.android.application' 
 

 
android { 
 
    compileSdkVersion 25 
 
    buildToolsVersion "25.0.2" 
 
    defaultConfig { 
 
     applicationId "com.example.quant.icarus" 
 
     minSdkVersion 23 
 
     targetSdkVersion 25 
 
     versionCode 1 
 
     versionName "1.0" 
 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
 

 
     externalNativeBuild { 
 
      ndkBuild { 
 
       def gstRoot 
 

 
       if (project.hasProperty('gstAndroidRoot')) 
 
        gstRoot = project.gstAndroidRoot 
 
       else 
 
        gstRoot = System.env.GSTREAMER_ROOT_ANDROID 
 

 
       if (gstRoot == null) 
 
        throw new GradleException('GSTREAMER_ROOT_ANDROID must be set, or "gstAndroidRoot" must be defined in your gradle.properties in the top level directory of the unpacked universal GStreamer Android binaries') 
 

 
       arguments "NDK_APPLICATION_MK=src/main/jni/Application.mk", "GSTREAMER_JAVA_SRC_DIR=src/main/java", "GSTREAMER_ROOT_ANDROID=$gstRoot", "GSTREAMER_ASSETS_DIR=src/main/assets" 
 

 
       targets "app", "gstreamer_android" 
 

 
       // All archs except MIPS and MIPS64 are supported 
 
       abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a' 
 
      } 
 
     } 
 
    } 
 
    buildTypes { 
 
     release { 
 
      minifyEnabled false 
 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
 
     } 
 
    } 
 
    externalNativeBuild { 
 
     ndkBuild { 
 
      path 'src/main/jni/Android.mk' 
 
     } 
 
    } 
 
} 
 

 
afterEvaluate { 
 
    compileDebugJavaWithJavac.dependsOn 'externalNativeBuildDebug' 
 
    compileReleaseJavaWithJavac.dependsOn 'externalNativeBuildRelease' 
 
} 
 

 
dependencies { 
 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
 
     exclude group: 'com.android.support', module: 'support-annotations' 
 
    }) 
 
    compile 'com.android.support:appcompat-v7:25.3.1' 
 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
 
    testCompile 'junit:junit:4.12' 
 
}

Gradleプロジェクトの同期は問題なく実行されます。しかし、プロジェクトは以下を生成してください:

エラー:エラー:無効なリンカ名引数の '-fuse-LD =金'

以上の冗長:

どれ

* What went wrong: 
 
Execution failed for task ':app:externalNativeBuildDebug'. 
 
> Build command failed. 
 
Error while executing process C:\Users\Quant\AppData\Local\Android\Sdk\ndk-bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Quant\AndroidStudioProjects\Icarus\app\src\main\jni\Android.mk NDK_APPLICATION_MK=C:\Users\Quant\AndroidStudioProjects\Icarus\app\src\main\jni\Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-23 NDK_OUT=C:/Users/Quant/AndroidStudioProjects/Icarus/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=C:\Users\Quant\AndroidStudioProjects\Icarus\app\build\intermediates\ndkBuild\debug\lib NDK_APPLICATION_MK=src/main/jni/Application.mk GSTREAMER_JAVA_SRC_DIR=src/main/java GSTREAMER_ROOT_ANDROID=C:\Users\Quant\Desktop\GStreamer\arm GSTREAMER_ASSETS_DIR=src/main/assets gst-build-arm64-v8a/libgstreamer_android.so} 
 
GStreamer  : [GEN] => gst-build-arm64-v8a/gstreamer_android.c 
 
GStreamer  : [COMPILE] => gst-build-arm64-v8a/gstreamer_android.c 
 
GStreamer  : [LINK] => gst-build-arm64-v8a/libgstreamer_android.so 
 
clang.exe: error: invalid linker name in argument '-fuse-ld=gold' 
 
make: *** [buildsharedlibrary_arm64-v8a] Error 1

これを修正する方法のアイデア?誰のフラグが設定されている場所を言っていない(とスレッドはすべてがあまりにも解決していないようでした)を除いて、私は...それはgold.exeにするためにフラグを追加すると言ういくつかのスレッドを見てきました。

ガイドをインストールするのGStreamerに示されているように私はそれが日付見えた場合でも、(私は同じエラーを取得した後ということでした - ので、それはそれを引き起こしていない)、「ld.exe」ファイルを置き換えます。

+0

gold-to-gold.exeを編集する場所が見つかりました。成功した場合は更新されます。誰かが重複としてマークする方法を知っている場合(私が新しい)、[この質問](https://stackoverflow.com/questions/40009987/gstreamer-linking-error)があります。 –

答えて

2

これは、ライブラリをリンクしようとしclang.exeプロセスに問題があります。インストール手順のように、ld.exeファイルを質問のリンクから変更する必要はありません。


修正:あなたはリンカーがgold.exeなくgoldとして呼び出されるように、GStreamerのディレクトリにアーキテクチャごとに2つのファイルを変更する必要があります。各アーキテクチャのために

あなたはあなたに興味を持っている(例としてarm64を使用して)に移動する必要があります。

1) path\to\Gstreamer\root\arm64\share\gst-android\ndk-build\gstreamer-1.0.mkと(それが唯一のファイルに一度表示されます)-fuse-ld=gold.exe-fuse-ld=goldを変更します。

今すぐに行く:

2) path\to\Gstreamer\root\arm64\include\gmp.h-fuse-ld=gold(再び、1回のみ)-fuse-ld=gold.exeに変更します。


あり、物事が完全にコンパイルするために取得する私の投稿Android.mkgradleファイルにはいくつかのマイナーな修正があったが、それはこの質問(ローカルLDLIBSに-llog追加され、コアだけのプラグインを使用)の範囲外と思われます。

関連する問題