libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
147 stars 50 forks source link

jnigenBuild cant find -<library> #61

Closed roiniti closed 1 year ago

roiniti commented 3 years ago

Im trying to build gdx-video with mp4 support for a project and when i execute jnigenBuild i get this error:

[exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux32/VideoDecoder.o' [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux32/com_badlogic_gdx_video_FfMpeg.o' [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux32/com_badlogic_gdx_video_VideoDecoder.o' [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux32/memcpy_wrap.o' [exec] '-lavformat' [exec] '-lavcodec' [exec] '-lavutil' [exec] '-lswscale' [exec] '-lswresample' [exec] '-lpthread' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux32/libavcodec' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux32/libavformat' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux32/libavutil' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux32/libswscale' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux32/libswresample' [exec] [exec] The ' characters around the executable and arguments are [exec] not part of the command. [exec] /usr/bin/ld: cannot find -lavformat [exec] /usr/bin/ld: cannot find -lavcodec [exec] /usr/bin/ld: cannot find -lavutil [exec] /usr/bin/ld: cannot find -lswscale [exec] /usr/bin/ld: cannot find -lswresample [exec] collect2: error: ld returned 1 exit status

   BUILD FAILED
   /home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/build-linux32.xml:160: exec returned: 1
    at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:645)
    at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
    at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:497)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
    at org.apache.tools.ant.Task.perform(Task.java:350)
    at org.apache.tools.ant.Target.execute(Target.java:449)
    at org.apache.tools.ant.Target.performTasks(Target.java:470)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:834)
    at org.apache.tools.ant.Main.startAnt(Main.java:223)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

Im executing at the shell "./gradlew jnigenBuild" on debian

SimonIT commented 3 years ago

@PokeMMO ideas?

PokeMMO commented 3 years ago

Try running ./gradlew buildFFmpeg first?

MrStahlfelge commented 3 years ago

Generally, a look at the workflow files helps finding out what to do to build the stuff: https://github.com/libgdx/gdx-video/blob/master/.github/workflows/gradle.yml

roiniti commented 3 years ago

./gradlew buildFFmpeg is working fine until it gets to ARM where i get:

arm-linux-gnueabihf-gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

> Task :gdx-video-desktop:buildFFmpegLinuxARM32 FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/build.gradle' line: 106

* What went wrong:
Execution failed for task ':gdx-video-desktop:buildFFmpegLinuxARM32'.
> Process 'command '../configure'' finished with non-zero exit value 1
roiniti commented 3 years ago

I followed the workflow files and it builded the linux32 but now in linux64 i get this error: [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux64/Utilities.o' [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux64/VideoDecoder.o' [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux64/com_badlogic_gdx_video_FfMpeg.o' [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux64/com_badlogic_gdx_video_VideoDecoder.o' [exec] '/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/target/linux64/memcpy_wrap.o' [exec] '-lavformat' [exec] '-lavcodec' [exec] '-lavutil' [exec] '-lswscale' [exec] '-lswresample' [exec] '-lpthread' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux64/libavcodec' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux64/libavformat' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux64/libavutil' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux64/libswscale' [exec] '-L/home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux64/libswresample' [exec] [exec] The ' characters around the executable and arguments are [exec] not part of the command. [exec] /usr/bin/ld: /home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux64/libavcodec/libavcodec.a(h264_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC [exec] /usr/bin/ld: final link failed: nonrepresentable section on output [exec] collect2: error: ld returned 1 exit status

    BUILD FAILED
    /home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/jni/build-linux64.xml:160: exec returned: 1
            at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:645)
            at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
            at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:497)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
            at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:566)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
            at org.apache.tools.ant.Task.perform(Task.java:350)
            at org.apache.tools.ant.Target.execute(Target.java:449)
            at org.apache.tools.ant.Target.performTasks(Target.java:470)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
            at org.apache.tools.ant.Main.runBuild(Main.java:834)
            at org.apache.tools.ant.Main.startAnt(Main.java:223)
            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

    Total time: 14 seconds

    > Task :gdx-video-desktop:jnigenBuildLinux64 FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':gdx-video-desktop:jnigenBuildLinux64'.
    > Ant execution for build-linux64.xml failed.
dasisdormax commented 1 year ago

I recently added some new build instructions to the README, I hope they help ...

[exec] /usr/bin/ld: /home/roiniti/Escritorio/ffmpg/gdx-video-master/gdx-video-desktop/FFmpeg/build-linux64/libavcodec/libavcodec.a(h264_cabac.o): relocation R_X86_64_PC32 against symbol `ff_h264_cabac_tables' can not be used when making a shared object; recompile with -fPIC

That shouldn't be an issue anymore, this was solved by adding -Wl,-Bsymbolic to the build flags on linux.