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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
:(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
:(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you can somehow get -fPIC on the compliation command line it should fix it
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
:(
the change did not appear to affect the command-line...
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)
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.
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
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
THX :) it works now!
--
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
:(