ffmpeg compile error __wrap_swr_convert - c++

I'm trying to compile ffmpeg from sources and can't resolve this issue
YASM libswresample/x86/resample.o
STRIP libswresample/x86/resample.o
CC libswresample/x86/resample_init.o
CC libswresample/x86/w64xmmtest.o
LD libswresample/libswresample.so.101
__wrap_swr_convert' referenced in section.text' of /tmp/cc6tTYGS.ltrans4.ltrans.o: defined in discarded section `.text' of libswresample/x86/w64xmmtest.o (symbol from plugin)
__wrap_swr_convert' referenced in section.text' of /tmp/cc6tTYGS.ltrans6.ltrans.o: defined in discarded section `.text' of libswresample/x86/w64xmmtest.o (symbol from plugin)
collect2: error: ld returned 1 exit status
library.mak:110: recipe for target 'libswresample/libswresample.so.101' failed
make: *** [libswresample/libswresample.so.101] Error 1
Linux Debian 8.1
please help me

w64xmmtest should only be used on Windows. I think you used configure --enable-xmm-clobber-test on Linux. Don't do that.

Related

Why is there this dune build error? 'cannot find -lz'

I am trying to build a project with this dune file:
src/lib/precomputed_values/gen_values/dune:
(executable
(name gen_values)
(flags -w -32)
(libraries
;; opam libraries
stdio
async_kernel
compiler-libs
core_kernel
ppxlib
ppxlib.ast
ppxlib.astlib
async
core
ocaml-migrate-parsetree
base
ocaml-compiler-libs.common
async_unix
base.caml
sexplib0
;; local libraries
coda_runtime_config
consensus
transaction_snark
mina_state
snark_params
coda_genesis_proof
blockchain_snark
mina_base
global_signer_private_key
ppx_util
snarky.backendless
genesis_constants
pickles
test_genesis_ledger
coda_genesis_ledger
staged_ledger_diff
)
(preprocessor_deps ../../../config.mlh)
(preprocess
(pps ppx_version ppx_optcomp ppx_let ppxlib.metaquot ppx_here))
(instrumentation (backend bisect_ppx))
(modes native))
But am getting the error:
File "src/lib/precomputed_values/gen_values/dune", line 2, characters 7-17:
2 | (name gen_values)
^^^^^^^^^^
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking (exit code 1)
Makefile:84: recipe for target 'build' failed
make: *** [build] Error 1
Could anyone point me in the right direction?
Thanks :)
Do you have the libz available on your system ? it looks like the ld linker does not find it in its search path.
libz.a is a C library that implements C function for compressing/decompressing data. Such libraries come with your OS distribution independently of Ocaml.
Ocaml tooling provides way to use C library (via stub) using ld (the standard linker) that will link your ocaml stubs to the functions of libz.a . But if the required library is missing, you get the error you quoted.
-lz is saying to ld to link your application with the libz.a (or libz.so) library that is usually located in /usr/lib - if libz.a (libz.so) is not there, the linker will fail causing the emission of the following message :
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status

Multiple definition error while linking: multiple definition of `typeinfo name

I'm very new to c++ (my background is in python and java) and I'm trying to build the cockroachdb project on a raspberry pi. To build I ran the command make build -j1.
However I am getting the error below:
[ 0%] Linking CXX shared library lib/libgeos.so
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.rodata+0x0): multiple definition of `typeinfo name for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.rodata+0x6c): first defined here
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0x0): multiple definition of `typeinfo for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0x20): first defined here
/usr/bin/ld: CMakeFiles/geos.dir/src/noding/BasicSegmentString.cpp.o:(.data.rel.ro+0xc): multiple definition of `vtable for geos::noding::BasicSegmentString'; CMakeFiles/geos.dir/src/inlines.cpp.o:(.data.rel.ro+0xac): first defined here
collect2: error: ld returned 1 exit status
make[4]: *** [CMakeFiles/geos.dir/build.make:4569: lib/libgeos.so.3.8.1] Error 1
make[3]: *** [CMakeFiles/Makefile2:569: CMakeFiles/geos.dir/all] Error 2
make[2]: *** [CMakeFiles/Makefile2:616: CMakeFiles/geos_c.dir/rule] Error 2
make[1]: *** [Makefile:418: geos_c] Error 2
make: *** [Makefile:757: libgeos_inner] Error 2
I went to CMakeFiles/geos.dir/build.make and on line 4569 I see:
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/geos.dir/link.txt --verbose=$(VERBOSE) but I don't really know what is wrong and what to do next to fix this.
Can someone help out a c++ beginner? Thank you.
apparently the issue has been around for a while. Workaround is to give -DDISABLE_GEOS_INLINE=ON as described on that page.
The respective switch is named differently on the GEOS Website though, yet that seems to be outdated information and does not work.

when gcc update, occi link error

when i update gcc 4.1 to gcc 5.1
i want to use occi11.2 connect to oracle11g
and have install
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-odbc-11.2.0.4.0-1.x86_64.rpm
a link error is:
/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only handles version 2 information.
output/MaintainEventList.o: In function _ZL20EventCommonStoreToDBP13st_SINGLELISTPN6oracle4occi10ConnectionE':
MaintainEventList.cpp:(.text+0x36a4): undefined reference to_ZNK6oracle4occi12SQLException10getMessageB5cxx11Ev'
MaintainEventList.cpp:(.text+0x3edb): undefined reference to `_ZNK6oracle4occi12SQLException10getMessageB5cxx11Ev'
collect2: error: ld returned 1 exit status
make: *** [bin/depositor] Error 1
how to deal with ?

recompile with -fPIC flag

I have a project (not mine) which I want to build. It has c++ and Python modules, which has to bind. When I launch cmake, I get this error:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libantlr.a(BitSet.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/libantlr.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [python/CModule.so] Error 1
make[1]: *** [pyBinding/CMakeFiles/CMODULE.dir/all] Error 2
make: *** [all] Error 2
I install antlr library with apt-get, and as I understand, I should recompile this library, but I have no idea in which part of source code of antlr library I should put -fPIC, or is there another way?
In Ubuntu 14.10 I have package libantlr-dev, which contains libantlr.a as well as libantlr-pic.a. I believe you have to use latter one, it is compiled with PIC

Issue with CMake project building

I have the following problem. On my Ubuntu I try to build a project and receive the following linker error(s) so far:
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libboost_thread.a(once.o): undefined reference to symbol 'pthread_once##GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO
missing from command line collect2: error: ld returned 1 exit status
make[2]: *** [sunprint] Error 1 make[1]: ***
[CMakeFiles/sunprint.dir/all] Error 2 make: *** [all] Error 2
*** Failure: Exit code 2 ***
I'm running under ubuntu 13 desktop, GCC 4.8, boost ver. is 1.54. As an IDE I'm working with
is the KDevelop.
I can provide any additional info about this issue if needed, but now I'm stuck with
this linking problem.
Any ideas?
Thanx in advance.
add_definitions only adds inputs for the preprocessor, which is in action even before the compiler starts its business and even much farther away from linking the executable, the step ld is supposed to be doing.
What you want to have ld resolve link-time dependencies is the CMake command target_link_libraries, which, for a given target, add a number of libs to link against after compilation.
In you case, the appropriate invocation could look like this
target_link_libraries(${PROJECT_NAME} [...] -lpthread [...]) #obviously without the '[...]' and the correct target name
I had a similar problem but with mpich. Both:
target_link_libraries(${PROJECT_NAME} [...] -lmpich [...])
and
target_link_libraries(${PROJECT_NAME} [...] mpich [...])
worked properly.