Log in

View Full Version : Compiling with Microsoft Visual Studio 2019 community edition


Ceppo
18th January 2021, 16:59
Is there a guide somewhere to compile avisynth plugins with Microsoft Visual Studio 2019 community edition? I tried (not sure what I'm doing) but I get random errors, fix one and 10 show up.

videoh
18th January 2021, 18:21
A guide is unlikely to help you with compile errors. Can you post a link to your project zipped up? I'll get it compiling for you. There were a number of things I had to do to migrate VS 2013 builds to VS 2019.

Ceppo
18th January 2021, 18:45
The fact is that I want to learn how to do it. I'm studying C++ and I'm at a good point so I thought to make some basic plugin (maybe I didn't specify it) so I started with the basic InvertNeg (http://avisynth.nl/index.php/Filter_SDK/InvertNeg) but I can't compile it so I can't get started.

videoh
18th January 2021, 20:41
Fair enough. Try this:

http://rationalqm.us/misc/InvertNeg.rar

Just double click on the solution (.sln) file and away you go.

Ceppo
18th January 2021, 21:03
Nice magic :thanks: you were of great help.

I don't want to disturb you further but could you please tell me which template did you chose to make the project?

videoh
18th January 2021, 23:29
Happy it was useful to you.

You don't need a template or anything. You just create a new bare (empty) DLL project (basic VS 2019 usage), because Avisynth plugins are DLLs. Add your source code and you're done. That includes proper Avisynth/Vapoursynth headers. Most people look for a sample full project like I sent you. The problem is that your InvertNeg link just gives the filter source code and not the full project. Pretty soon you'll be whipping these things out like...confetti?

Ceppo
19th January 2021, 00:04
I see how it works now, didn't occur to me. If I may ask another thing then I promise I'm on my own :p

I tried compiling Non-clip sample (http://avisynth.nl/index.php/Filter_SDK/Non-clip_sample) and all of them don't compile giving me errors and warnings while nothing of this happens with InvertNeg and simple-sample. I tried fixing minor mistakes but not much is changed. All the warnings are about avisynth.h that is strange since it gives no problems with the other filters.

Can you help me on this? pretty please :thanks:

videoh
19th January 2021, 03:59
You have to use AvisynthPluginInit3() as shown in my sample. Your linked code is for older Avisynth versions.

Generally, you need to show your actual code and the compiler errors if you want help. We cannot read your mind.

Ceppo
19th January 2021, 20:07
I see, thank you very much for all your help. :D