Menu

Compilation error on OpenSUSE 10.3 64 bit

user
2007-11-06
2013-05-09
  • Nobody/Anonymous

    Hi!

    I'm getting the following error when compiling fobs4jmf from svn on my 64 bit machine :(

    ar: creating lib/libfobs.a
    g++ -g -dynamic -shared -o lib/fobs4jmf/libfobs4jmf.so src/jmf-pi/decoder.os src/jmf-pi/stand_alone_codec.os -L/home/jack/fobs-build/ffmpeg/lib -L/home/jack/fobs-build/ffmpeg/libavcodec -L/home/jack/fobs-build/ffmpeg/libavformat -L/home/jack/fobs-build/ffmpeg/libavutil -Llib -Lresources/lib -lfobs -lavformat -lavcodec -lavutil -lfaas -lfaad -lmp3lame -lx264 -ldl
    /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: lib/libfobs.a(Decoder.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
    lib/libfobs.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    scons: *** [lib/fobs4jmf/libfobs4jmf.so] Error 1

    Jack

     
    • Ken Larson

      Ken Larson - 2007-11-06

      If you can somehow get -fPIC on the compliation command line it should fix it

       
    • Nobody/Anonymous

      Thx. Ok, if I add the following to src/cppapi/SConstruct and src/jmf-pi/SConstruct

      env.Append(CCFLAGS=['-fPIC'])

      it should do it? Seems not I get the same error:

      ar: creating lib/libfobs.a
      g++ -g -dynamic -shared -o lib/fobs4jmf/libfobs4jmf.so src/jmf-pi/decoder.os src/jmf-pi/stand_alone_codec.os -L/home/jack/fobs-build/ffmpeg/lib -L/home/jack/fobs-build/ffmpeg/libavcodec -L/home/jack/fobs-build/ffmpeg/libavformat -L/home/jack/fobs-build/ffmpeg/libavutil -Llib -Lresources/lib -lfobs -lavformat -lavcodec -lavutil -lfaac -lfaad -lmp3lame -lx264 -ldl
      /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: /home/jack/fobs-build/ffmpeg/libavformat/libavformat.a(utils.o): relocation R_X86_64_32 against `first_iformat' can not be used when making a shared object; recompile with -fPIC
      /home/tobias/fobs-build/ffmpeg/libavformat/libavformat.a: could not read symbols: Bad value

      :(

       
      • Ken Larson

        Ken Larson - 2007-11-06

        the change did not appear to affect the command-line...

         
    • Nobody/Anonymous

      Yes, well I don't know where to add the statement: here's my src/cppapi/SConstruct:

      ffmpeg_path=fobs.FFMPEG_HOME

      env = Environment()

      ffmpeg_lib_deps = ['avformat', 'avcodec','avutil'] + fobs.EXTERNAL_LIBS
      if env['PLATFORM'] == 'posix':
              ffmpeg_lib_deps += ['dl','pthread'] #,z
      elif env['PLATFORM'] == 'win32':
              env = Environment(tools=['mingw'])
      else:
         ffmpeg_lib_deps += ['z']

      env.Append(CPPPATH=[ffmpeg_path,ffmpeg_path+'/include/ffmpeg', ffmpeg_path+'/libavcodec', ffmpeg_path+'/libavformat', ffmpeg_path+'/libswscale', ffmpeg_path+'/libavutil']+fobs.EXTERNAL_INC_PATHS)
      env.Append(LIBPATH=[ffmpeg_path+'/lib',ffmpeg_path+'/libavcodec', ffmpeg_path+'/libavformat', ffmpeg_path+'/libavutil', '#lib']+fobs.EXTERNAL_LIB_PATHS)

      if fobs.DEBUG_SYMBOLS == 'yes':
          env.Append(LINKFLAGS=['-g'])
          env.Append(CCFLAGS=['-g'])
      if fobs.OPTIMIZATIONS == 'yes':
          env.Append(LINKFLAGS=['-O3'])
          env.Append(CCFLAGS=['-O3'])

      if sys.platform == 'darwin':
              env['SHLINKFLAGS'] = '$LINKFLAGS -dynamiclib -read_only_relocs warning -single_module'
              env.Append(CCFLAGS=['-D', '__STDC_CONSTANT_MACROS'])

      env.Append(CCFLAGS=['-fPIC'])

      env.Library('#lib/fobs',Split('PacketBuffer.cpp Decoder.cpp Encoder.cpp Transcoder.cpp Error.cpp'))
      #env.SharedLibrary('#lib/fobsdyn', Split('PacketBuffer.o Decoder.o Encoder.o Transcoder.o Error.o'), LIBS=['fobs']+ffmpeg_lib_deps)
      env.Install('#lib', Split('Decoder.h Encoder.h Transcoder.h Error.h common.h'))
      env.Program('#lib/samples/test','test.cpp', LIBS=['fobs']+ffmpeg_lib_deps)
      env.Program('#lib/samples/tc','tc.cpp', LIBS=['fobs']+ffmpeg_lib_deps)
      env.Program('#lib/samples/reencoder','reencoder.cpp', LIBS=['fobs']+ffmpeg_lib_deps)

       
      • Ken Larson

        Ken Larson - 2007-11-06

        Sorry, I've definitely run into the fpic problem in other projects, and adding it has worked, but I'm not familiar with fobs's build process.

         
    • Nobody/Anonymous

      Ok. I've taken a step forward. env.Append(CCFLAGS=['-fPIC']) did the trick but I had to recompile the libraries (in my case faad, faac, x264, lame). But now I get another error :(

      ...
      /home/tobias/fobs-build/ffmpeg/libavcodec/tscc.c:217: undefined reference to `inflate'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(tscc.o): In function `decode_end':
      /home/tobias/fobs-build/ffmpeg/libavcodec/tscc.c:328: undefined reference to `inflateEnd'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(tscc.o): In function `decode_init':
      /home/tobias/fobs-build/ffmpeg/libavcodec/tscc.c:302: undefined reference to `inflateInit_'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(lclenc.o): In function `encode_end':
      /home/tobias/fobs-build/ffmpeg/libavcodec/lclenc.c:217: undefined reference to `deflateEnd'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(lclenc.o): In function `encode_frame':
      /home/tobias/fobs-build/ffmpeg/libavcodec/lclenc.c:106: undefined reference to `deflateReset'
      /home/tobias/fobs-build/ffmpeg/libavcodec/lclenc.c:117: undefined reference to `deflate'
      /home/tobias/fobs-build/ffmpeg/libavcodec/lclenc.c:123: undefined reference to `deflate'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(lclenc.o): In function `encode_init':
      /home/tobias/fobs-build/ffmpeg/libavcodec/lclenc.c:187: undefined reference to `deflateInit_'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(zmbv.o): In function `decode_frame':
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbv.c:497: undefined reference to `inflate'
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbv.c:471: undefined reference to `inflateReset'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(zmbv.o): In function `decode_end':
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbv.c:648: undefined reference to `inflateEnd'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(zmbv.o): In function `decode_init':
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbv.c:624: undefined reference to `inflateInit_'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(zmbvenc.o): In function `encode_end':
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbvenc.c:307: undefined reference to `deflateEnd'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(zmbvenc.o): In function `encode_frame':
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbvenc.c:132: undefined reference to `deflateReset'
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbvenc.c:221: undefined reference to `deflate'
      /home/tobias/fobs-build/ffmpeg/libavcodec/libavcodec.a(zmbvenc.o): In function `encode_init':
      /home/tobias/fobs-build/ffmpeg/libavcodec/zmbvenc.c:286: undefined reference to `deflateInit_'
      collect2: ld returned 1 exit status
      scons: *** [lib/samples/reencoder] Error 1

       
      • Jose San Pedro

        Jose San Pedro - 2007-11-06

        Hi,

        for the previous error, you just needed to append the line in both SConstruct files both in
        src/cppapi
        src/jmfpi

        you were just adding it in the src/cppapi and the error was happening in the other directory.

        For this other error, you seem to be needing the libz library. Try to append it too to the command line, either manually (editing the appropriate SConstruct files) or by using the parameters of the buildFobs.sh script (see Documentation in the Fobs page to know more about these).

        Jose San Pedro

         
    • Nobody/Anonymous

      THX :) it works now!

      --

       
    • Nobody/Anonymous

      Hm, I was too quick. It build fine now, but when using:

           [java] Fobs4JMF - Native shared library found
           [java] #
           [java] # An unexpected error has been detected by Java Runtime Environment:
           [java] #
           [java] #  SIGSEGV (0xb) at pc=0x00002aaaf922f1bb, pid=26468, tid=1088649552
           [java] #
           [java] # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0_03-b05 mixed mode)
           [java] # Problematic frame:
           [java] # C  [libfobs4jmf.so.3+0x421bb]  _ZN9omnividea4fobs7DecoderD1Ev+0x1b
           [java] #
           [java] # An error report file with more information is saved as hs_err_pid26468.log
           [java] #
           [java] # If you would like to submit a bug report, please visit:
           [java] #   http://java.sun.com/webapps/bugreport/crash.jsp
           [java] #
           [java] Java Result: 134

      :(

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.