Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: olir on June 05, 2017, 04:49:01 PM

Title: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: olir on June 05, 2017, 04:49:01 PM
I got an error when compiling sample videofilter under windows that is not handle under "Important/Common problem".

Fresh installed Software today: avidemux_2.6.21_win64.exe, msys2-x86_64-20161025.exe, mingw-w64-install.exe, cmake-3.8.2-win64-x64.msi
cmake worked fine.

CLI output of mingw32-make:
==============
...
/C/Mingw64/mingw64/bin/g++.exe   -fmessage-length=0  -shared -o libADM_vf_logo_sample.dll -Wl,--out-implib,libADM_vf_logo_sample.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles/ADM_vf_logo_sample.dir/objects.a -Wl,--no-whole-archive @CMakeFiles/ADM_vf_logo_sample.dir/linklibs.rsp
CMakeFiles/ADM_vf_logo_sample.dir/objects.a(ADM_vidLogo.cpp.obj):ADM_vidLogo.cpp:(.text+0x55b): undefined reference to `__imp__ZN11diaElemFileC1EjRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcS8_S8_'
collect2.exe: error: ld returned 1 exit status
CMakeFiles/ADM_vf_logo_sample.dir/build.make:99: recipe for target 'libADM_vf_logo_sample.dll' failed
mingw32-make[2]: *** [libADM_vf_logo_sample.dll] Error 1
...

Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: mean on June 05, 2017, 04:52:52 PM
try adding
ADD_DEFINITIONS("-std=c++11")

at the top of the makefile


Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: olir on June 05, 2017, 04:59:50 PM
Did not work. cleared build, run cmake, edited, and run make.
Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: mean on June 05, 2017, 05:05:59 PM
edit:top of the cmakelists.txt
Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: olir on June 05, 2017, 05:13:34 PM
Same result. Error still there.  :o
Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: mean on June 05, 2017, 05:26:32 PM
the opposite then
ADD_DEFINITIONS("-std=c++98")

or

ADD_DEFINITIONS("-std=g++98")


Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: olir on June 05, 2017, 05:32:25 PM
ADD_DEFINITIONS("-std=c++98")  had no effect

ADD_DEFINITIONS("-std=g++98") raised the error:   g++.exe: error: unrecognized command line option '-std=g++98'

$ g++.exe -v
Using built-in specs.
COLLECT_GCC=C:\Mingw64\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=C:/Mingw64/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/5.3.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-5.3.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw530/x86_64-530-win32-seh-rt_v4-rev0/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw530/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-win32-seh-rev0, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw530/x86_64-530-win32-seh-rt_v4-rev0/mingw64/opt/include -I/c/mingw530/prerequisites/x86_64-zlib-static/include -I/c/mingw530/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw530/x86_64-530-win32-seh-rt_v4-rev0/mingw64/opt/include -I/c/mingw530/prerequisites/x86_64-zlib-static/include -I/c/mingw530/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw530/x86_64-530-win32-seh-rt_v4-rev0/mingw64/opt/lib -L/c/mingw530/prerequisites/x86_64-zlib-static/lib -L/c/mingw530/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: win32
gcc version 5.3.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)

Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: olir on June 05, 2017, 06:06:10 PM
Which library is the symbol in? Does it maybe need to be linked directly?
Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: mean on June 05, 2017, 07:38:49 PM
The problem is the lib export foobar
and the object you compiled requires
foobar_cx11

Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: olir on June 06, 2017, 04:37:36 AM
Thank you, for this very fast response and trying to help. 
Title: Re: Sample videofilter Demo does not compile. New Error 'undefined reference'
Post by: mean on June 06, 2017, 07:36:27 PM
The simplest is to use mxe
It takes a bit of time to compile but it works well
and you have everything compiled with the same compiler which is crucial on windows