Giter Site home page Giter Site logo

Compilation errors about tivtc HOT 13 CLOSED

flossy83 avatar flossy83 commented on September 28, 2024
Compilation errors

from tivtc.

Comments (13)

pinterf avatar pinterf commented on September 28, 2024 1

Yes, mingw built C++ plugins are compatible only with mingw build Avisynth+.
(following the README.md build instructions I've encountered the missing header, so I fixed it).
As for Visual Studio: open the solution file (.sln) in the IDE and build the project. I usually do this.

from tivtc.

qyot27 avatar qyot27 commented on September 28, 2024 1

It looks like the first make command autodetected my CPU as AMD - "-- Detected target processor as: AMD64". Is that correct? My CPU is Intel i5-4570. Are there some makefile switches I can set to tell it to try building a different version?

amd64 is just the architecture name used by some distros and projects, because AMD was the one that actually extended x86 into x86_64.

Using VS through the command-line CMake interface can be done by first launching the Visual Studio Command Prompt and specifying "Visual Studio XX 20YY" as the generator, where the XX and YY refer to whatever version of VS is being used (16 2019, for example).

Overriding/appending CMAKE_CXX_FLAGS or CMAKE_SHARED_LINKER_FLAGS doesn't usually involve needing to edit CMakeLists.txt, as virtually every sort of thing you can set() inside of them can also be passed to the CLI at configure time, e.g. -DCMAKE_CXX_FLAGS="-static" or -DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc".

But yes, as stated, GCC and MSVC use incompatible C++ ABIs and you can't mix and match host and plugins across compilers. And by default, GCC-built AviSynth+ actually looks in a completely different set of directories for plugins (plugins_gcc and plugins64_gcc), so as not to cause load errors.

from tivtc.

pinterf avatar pinterf commented on September 28, 2024 1

The solution and project files are set to v143 platform toolset, this is what vs2022 uses. For vs2019 go into config and change that to v142 toolset, that must be fine.

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

Oh I tried putting #include <memory> in info.h and info.cpp like the compiler error suggested and it works now, I get a TIVTC.dll file.

But, Avisynth doesn't see it:

Untitled-1

edit: I tried LoadPlugin() and LoadCPlugin(), no effect.

I guess it must have built wrongly - here is the built file.

It looks like the first make command autodetected my CPU as AMD - "-- Detected target processor as: AMD64". Is that correct? My CPU is Intel i5-4570. Are there some makefile switches I can set to tell it to try building a different version?

Here is the successful second build output:

# cmake --build . --config Release
[  2%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/__/common/TCommonASM.cpp.obj
[  5%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/__/common/fixedfonts.cpp.obj
[  7%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/__/common/info.cpp.obj
In file included from C:\TIVTC-master\src\common\info.cpp:27:
C:/TIVTC-master/src/include/avs/win.h:44: warning: "STRICT" redefined
   44 | #define STRICT
      |
In file included from C:/msys64/mingw64/include/windef.h:9,
                 from C:/msys64/mingw64/include/windows.h:69,
                 from C:\TIVTC-master\src\common\internal.h:12,
                 from C:\TIVTC-master\src\common\info.h:30,
                 from C:\TIVTC-master\src\common\info.cpp:23:
C:/msys64/mingw64/include/minwindef.h:11: note: this is the location of the previous definition
   11 | #define STRICT 1
      |
[ 10%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/__/common/internal.cpp.obj
[ 12%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/Cache.cpp.obj
[ 15%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/Cycle.cpp.obj
[ 17%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/FieldDiff.cpp.obj
[ 20%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/FrameDiff.cpp.obj
[ 22%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/IsCombedTIVTC.cpp.obj
[ 25%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/MergeHints.cpp.obj
[ 27%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/PlanarFrame.cpp.obj
[ 30%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/PluginInit.cpp.obj
[ 32%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/RequestLinear.cpp.obj
[ 35%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TDecimate.cpp.obj
[ 37%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TDecimateASM.cpp.obj
[ 40%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TDecimateBlur.cpp.obj
[ 42%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TDecimateMode2.cpp.obj
[ 45%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TDecimateMode7.cpp.obj
[ 47%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TDecimateOut.cpp.obj
[ 50%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TFM.cpp.obj
[ 52%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TFMASM.cpp.obj
[ 55%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TFMD2V.cpp.obj
[ 57%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TFMPP.cpp.obj
[ 60%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TFMPlanar.cpp.obj
[ 62%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/TFMYUY2.cpp.obj
[ 65%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/calcCRC.cpp.obj
[ 67%] Building CXX object TIVTC/CMakeFiles/TIVTC.dir/profUtil.cpp.obj
[ 70%] Linking CXX shared library TIVTC.dll
[ 70%] Built target TIVTC
[ 72%] Building CXX object TDeint/CMakeFiles/TDeint.dir/__/common/TCommonASM.cpp.obj
[ 75%] Building CXX object TDeint/CMakeFiles/TDeint.dir/__/common/fixedfonts.cpp.obj
[ 77%] Building CXX object TDeint/CMakeFiles/TDeint.dir/__/common/info.cpp.obj
In file included from C:\TIVTC-master\src\common\info.cpp:27:
C:/TIVTC-master/src/include/avs/win.h:44: warning: "STRICT" redefined
   44 | #define STRICT
      |
In file included from C:/msys64/mingw64/include/windef.h:9,
                 from C:/msys64/mingw64/include/windows.h:69,
                 from C:\TIVTC-master\src\common\internal.h:12,
                 from C:\TIVTC-master\src\common\info.h:30,
                 from C:\TIVTC-master\src\common\info.cpp:23:
C:/msys64/mingw64/include/minwindef.h:11: note: this is the location of the previous definition
   11 | #define STRICT 1
      |
[ 80%] Building CXX object TDeint/CMakeFiles/TDeint.dir/__/common/internal.cpp.obj
[ 82%] Building CXX object TDeint/CMakeFiles/TDeint.dir/TDBuf.cpp.obj
[ 85%] Building CXX object TDeint/CMakeFiles/TDeint.dir/TDeintASM.cpp.obj
[ 87%] Building CXX object TDeint/CMakeFiles/TDeint.dir/TDeinterlace.cpp.obj
[ 90%] Building CXX object TDeint/CMakeFiles/TDeint.dir/TDeinterlacePlanar.cpp.obj
[ 92%] Building CXX object TDeint/CMakeFiles/TDeint.dir/TDeinterlaceYUY2.cpp.obj
[ 95%] Building CXX object TDeint/CMakeFiles/TDeint.dir/THelper.cpp.obj
[ 97%] Building CXX object TDeint/CMakeFiles/TDeint.dir/TSwitch.cpp.obj
[100%] Linking CXX shared library TDeint.dll
[100%] Built target TDeint

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

If I move the TIVTC.dll to another location, eg. C:\ and do a LoadPlugin("C:\TIVTC.dll") then I get a meaningful error message code 126:

debug avs_snapshot_00 01 356

I don't know why it shows it as forward slash, it's definitely a backslash in my script

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

Seems to be missing some libgcc dependencies...

Untitled-1 copy

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

I think I need to tell GCC to include those dependencies in the compilation, but I don't know how

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

According to a StackOverflow post I need to compile with flags: -static-libstdc++ -static-libgcc

But I'm not sure how to do that -- do I need to modify the makefiles?

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

Tried putting set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") inside all CMakeLists.txt files to no effect

from tivtc.

pinterf avatar pinterf commented on September 28, 2024

Are you using mingw built Avisynth+? Mingw and Windows-style DLLs are not ABI compatible. Plugin using C interface has no problems, but they are very rare. The real expert of MSys2/Mingw64 is @qyot27, I'd ask him.

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

Are you using mingw built Avisynth+?

I'm using the current latest public release from the GitHub repository, so I guess that means no.

I managed to include all those GCC dependencies in TIVTC.dll by putting set(CMAKE_CXX_FLAGS "-static") inside all CMakeLists.txt files - in this case Avisynth Info Tool reports no problems with the .dll but I still get the "no function named TDecimate" when trying to call TDecimate().

But LoadPlugin("C:\TIVTC.dll") doesn't throw an error anymore, and the TIVTC.dll is bigger so I know it included those GCC dependencies.

So I guess the GCC builds just aren't compatible with the public release build of Avisynth, so I probably have to use Visual Studio to compile it instead, have I got that right? How are you compiling it?

from tivtc.

pinterf avatar pinterf commented on September 28, 2024

(As for mingw built DLL / Load error 126: The missing DLLs (standard c++ library, posix threads, library (but I don't think TIVTC is using that) are somewhere in your gcc directory. The command ldd <your_dll_name> can list the dependencies if they are not statically linked (as you finally did).

from tivtc.

flossy83 avatar flossy83 commented on September 28, 2024

Thanks, a bit disappointing as I was trying to avoid using the Visual Studio GUI . I tried the 2019 Community version and it's ok but it only lets me compile the CLang version due to missing compilation tools. Guess I need the 2022 version?

from tivtc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.