Log in

View Full Version : Compiling AviSynth


Pages : [1] 2 3 4

WarpEnterprises
2nd January 2003, 22:10
Could someone please summarize what is necessary to compile AviSynth?

I've installed VC6, SP5, ProcessorPack.

There is still an error regarding DirectShow.

Do I have to download some whole SDKs or are only some files needed?

sh0dan
2nd January 2003, 23:11
Unfortunately it seems to require both the DirectX 8.1 SDK and the newest platform SDK, which are both rather big.

WarpEnterprises
7th January 2003, 23:13
Can you give me a hint what the "newest platform SDK" is?
At MS it seems to me it is only a combination of SDK's including DX8.1 which would then not be necessary.

Sadly DX8.1 SDK is not enough - now it compiles but there are linker errors (non-resolved external symbols, regarding ACM it seems).

Some clues for me? Or are there some settings necessary for the project I am not aware of?

sh0dan
7th January 2003, 23:22
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

Install the Core SDK and DirectX SDK. You can de-select download of 64bit stuff (you can also do fine without samples and documentation), but Choosing Downloads/Install from the menu at the top.

If you take only "Build environment", you only have to download about 37mb.

scmccarthy
7th January 2003, 23:51
'only' 37mb hehe.

JohnMK
8th January 2003, 06:24
So how easy is it to build this thing with VC6 SP5 w/ ICL7? Does the code come with a project file that would streamline the process? I'd love to compile with P4-optimized switches and see if there's any difference.

WarpEnterprises
8th January 2003, 08:31
I will tell my stepwise progress.
The project file is I think a VC7-file, no VC6. But I only added all files to an empty DLL project and at least compiling worked.
Let's see what happens with the complete core SDK... (just downloading 342MB - still faster as 37MB on 56k)

sh0dan
8th January 2003, 09:18
Load the .dsw into VC6. AviSynth is being developed on VC6, so you shouldn't need to create a new project.

WarpEnterprises
8th January 2003, 12:49
Where is such a DSW? (at sourceforge there is nothing, only a "hidden" quite old DSW and a "vcproj" file).

sh0dan
8th January 2003, 13:49
When you do a complete checkout there is both a dsw and a dsp. Neither of them should be hidden.

Bidoche
8th January 2003, 14:42
I got these dsw files with a checkout, and VC6 has no problem dealing with them.
But I got errors with the asm file when building, does the Core SDK solve this ?

WarpEnterprises
8th January 2003, 14:56
are we talking about this file:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/avisynth2/avisynth/Attic/avisynth.dsw

sh0dan
8th January 2003, 15:20
Hmmm.. strange - but doesn't VC6 generate a dsw, when you open the project file, avisynth.dsp ?

WarpEnterprises
9th January 2003, 11:35
Ok, my mistake: .DSW is the workspace file, .DSP the project file which is ok from SF.

As you mentioned, both the core SDK + DirectX SDK are necessary

What is necessary too and was nowhere mentioned when setting up the project from scratch:

* include the convert_a.asm file and set up the assembler for this file (this is logical)

* add some lib files to the project (penter.lib msacm32.lib quartz.lib ddraw.lib amstrmid.lib vfw32.lib version.lib user32.lib winmm.lib) - how do you know that these files are necessary?

* (maybe) setting to PentiumPro code generation

With these changes it compiles.
Don't have checked if working flawlessly.

sh0dan
9th January 2003, 15:16
1) convert_a.asm is included in the project file, and is compiling fine, when you have the preprocessor pack 5 installed. No user action required here if your installation is ok.

2) These lib files are in the platform SDK, and if you read the documentation for these, it says you must add the lib directories in Tools/Options/Directories - no need to add them manually. You must have DirectX and Core SDK headers/libraries here, and move them to the top (I cannot remember the exact order of these two).

3) This is stored in the .dsp file, so you get the optimizations from the CVS. Be careful - enabling "Maximize speed" may break temporalsoften - it seems to cause a bug in the experimental cache.

WarpEnterprises
9th January 2003, 15:42
ad 2) I understand that I have to add the path to the lib files, but isn't it necessary to add the libs in the project properties (under the c++ tab)? I did mean _this_ action, not copying the LIB-files.
So from where comes the information that those LIB's are used?

Only the linker complains about missing symbols.

Maybe I simply don't know enough what a .LIB file is :(

scmccarthy
9th January 2003, 18:14
Maybe I simply don't know enough what a .LIB file is
I hope you don't mind if I point out some basics of compiling?

First, the lib file is only added by the linker. That means if you tried compiling without linking, you would not get an error if you did not have the libs you need. I think there are two catagories of libs: ones that the linker looks for for any c++ project and ones that the program calls for. I am not sure of that, but it doesn't matter, we're only focusing on the specific ones for each project.

lib files contain methods, fuctions, procedures, or whatever you want to call them, that are called by the program. The linker only has to read the object files to know the names of the needed lib files. The only thing it doesn't know is where the lib files are. So all you need to do in this case is put the lib folder for the Platform SDK and DirectX SDK on the search path for the linker. There is no need to name each lib file it is going to need.

So my main point is to explain why the linker only needs the search path to the lib directories it will need and not the names of the lib files themselves.

Of course, the compiler still needs to know which libs contain the code for the procedures called. I'm guessing that information is in the sources.

Stephen

WarpEnterprises
11th January 2003, 22:57
Thx, after reading a little bit MSDN I think I get it now.
("explicit and implicit linking")

1.You need a LIB file if you link to a DLL statically (implicit). This is the way AviSynth calls OS DLLs. Each function call (e.g. to ACM) aims at a DLL and each of those DLLs must have a LIB. So only complete knowledge of the source will tell you which DLLs are involved as they are not written somewhere. And the header files defining the functions don't have always simply the same name as the DLL.

2.If the DLL is linked explicit / dynamically you don't need a LIB, the functions are returned as pointers. This is a little more complex to program, it seems, but this is the way AviSynth calls the plugins. It has to be that way because the name of the DLL is of course not fixed when compiling AviSynth.

scmccarthy
12th January 2003, 01:45
@WarpEnterprises

I think you need the lib file for the os dlls whether you link to them dynamically or statically. It you link to it dynamically, you still need the address of the function within the dll you are calling. Unlike the little dll we write for AviSynth or even the AviSynth dll itself, a dll like kernel32.dll has multiple indepentant programs. The calling program needs the address of the specific program being called within the dll. That information is given to the calling program by the linker through kernel32.lib. So I believe that you always need the lib file for an os dll whether you link to it statically or dynamically.

My guess is that AviSynth is able to load its own dlls from a script mainly because there is a set starting place for the one program within each dll.

That is great work though, and I wonder if static and implicit are not really synonymous. So that you are half right.

Stephen

WarpEnterprises
7th April 2003, 23:18
help needed again...

AviSynth won't compile anymore, there are many linker errors (mainly imagelib, softwire) regardless which configuration I use.

Is there something I must do except using the .DSP file?

sh0dan
8th April 2003, 16:46
The new dsp file should contain the new libraries - what's in your distrib/lib directory?

WarpEnterprises
8th April 2003, 20:54
found the cause.
There still is a warning about a conflict witg LIBC, but it compiles.
When I started a Version() script with VD, it wrote "cannot determine filetype" (thought it was a bad compile) - instead the lib's AND the DLL's (libjpeg.dll, libpng13.dll) have to be present.

(wanted to add Chr, Spline, Time. Let's see if I manage it)

Richard Berg
15th April 2003, 06:34
The only required file with the latest CVS binary should be devil.dll (libs are always compile-time only). You're right about the meaning of that VDub error message, though -- perhaps we should stick it in a FAQ somewhere?

WarpEnterprises
17th April 2003, 21:52
Which runtime library is the right one for a plugin / does it matter / when and how?

- singlethreaded
- multithreaded
- multithreaded DLL

trbarry
27th April 2003, 03:02
Could anyone list the order of the libs and includes needed to compile Avisynth?

I installed XP and re-installed VS6 and lost all those settings.

Even just compiling my filters I get an undefined in _aligned_malloc()

I remember this error depends upon the order of the libs or includes since older versions of whaterver the storage module is don't have it.

But some of my filters will crash on P4's if I don't use that.

- Tom

Guest
27th April 2003, 04:36
You need the Platform SDK installed.

trbarry
27th April 2003, 04:57
Darn.

I could have sworn I pointed both libs and includes at both the DXSDK and the Platform SDK (from Win/Me) before posting, in some order. I just wasn't sure which one had the _aligned_malloc().

But I'll go check again since half of my stuff doesn't compile yet.

- Tom

trbarry
27th April 2003, 05:47
Okay, never mind.

I had not reinstalled the processor pack yet. I guess that's where the _aligned_malloc() comes from.

Google is your friend. ;)

- Tom

IanB
16th June 2003, 01:12
Okay guys,

What have I got wrong?

I've installed VS 6 SP5 + Processor pack, DX 8.1 & Feb 2003 Platform SDK. Great I can even build a VirtualDub.

Now I try to build AviSynth.dll from the source tarballs (2.08, 2.50 & recent CVS) without mods and get the following error(s) :-


amstrmid.lib(strmiids.obj) : error LNK2005: _CLSID_TVEFilterStatsProperties already defined in source.obj
amstrmid.lib(strmiids.obj) : error LNK2005: _CLSID_TVEFilterCCProperties already defined in source.obj
amstrmid.lib(strmiids.obj) : error LNK2005: _CLSID_TVEFilterTuneProperties already defined in source.obj
.....
amstrmid.lib(strmiids.obj) : error LNK2005: _MEDIATYPE_Video already defined in source.obj
amstrmid.lib(strmiids.obj) : error LNK2005: _MEDIASUBTYPE_None already defined in source.obj
amstrmid.lib(strmiids.obj) : warning LNK4006: _CLSID_TVEFilterStatsProperties already defined in source.obj; second definition ignored
amstrmid.lib(strmiids.obj) : warning LNK4006: _CLSID_TVEFilterCCProperties already defined in source.obj; second definition ignored
amstrmid.lib(strmiids.obj) : warning LNK4006: _CLSID_TVEFilterTuneProperties already defined in source.obj; second definition ignored
....
amstrmid.lib(strmiids.obj) : warning LNK4006: _MEDIATYPE_Video already defined in source.obj; second definition ignored
amstrmid.lib(strmiids.obj) : warning LNK4006: _MEDIASUBTYPE_None already defined in source.obj; second definition ignored
Creating library Release/avisynth.lib and object Release/avisynth.exp
Release/avisynth.dll : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

avisynth.dll - 326 error(s), 325 warning(s)



Yes the GUID's are being initted twice. I can hack "source.cpp" to remove "#include <initguid.h>" (which is line 666 :devil: in the 2.08 source) and get clean and working builds.

But thats not the point of the exercise.

How do I build the same way you do, without hacking the source?

I know I'll kick myself when I find the fix.

Regards
IanB

sh0dan
17th June 2003, 20:58
You should probably adjust you libraries. My current setup:

Tools/Options/Directories/Libraries (http://cultact-server.novi.dk/kpo/avisynth/libs.png)

and headers just for the record.

Tools/Options/Directories/Include (http://cultact-server.novi.dk/kpo/avisynth/include.png)

Remember - the order of the headers/libraries matter!
Also remember to "Recompile all" after changing these directories.

There is usually some black magic involved in getting AviSynth (and ff***) to compile ;) However I don't seem to remember any nasty copy/overwrite stuff this time

IanB
18th June 2003, 13:40
@sh0dan

Thanks, getting the order compatible does the trick. :D


For future reference (in text) Include's and Lib's :-

1. DXSDK
2. Microsoft SDK
3. VC98
4. VC98\MFC
5. VC98\ATL

IanB

MrPiercer
22nd June 2003, 19:55
Originally posted by sh0dan
Unfortunately it seems to require both the DirectX 8.1 SDK and the newest platform SDK, which are both rather big.

So, now I'm downloading the DirectX 9 SDK, but what exactly is the "Platform SDK" you're talking about here?

I have the complete Visual Studio .NET (7.0) installed, and I haven't installed anything else than the defaults from the CD distribution. Is the "Platform SDK" some 3:rd party stuff, or what is it, exactly?

Later! :)
Anders.

IanB
23rd June 2003, 04:17
Originally posted by MrPiercer
So, now I'm downloading the DirectX 9 SDK, but what exactly is the "Platform SDK" you're talking about here?

I have the complete Visual Studio .NET (7.0) installed, and I haven't installed anything else than the defaults from the CD distribution. Is the "Platform SDK" some 3:rd party stuff, or what is it, exactly?

Later! :)
Anders. MrPiercer,

You only need DirectX 8.1 (let this thread know how it compiles with DX9)

"Microsoft Platform SDK - February 2003"
"English Disc 0004.7 May 2003"

Is the title from the May MSDN release.

The CD is a Web tree clone so I guess it must be available @ msdn.microsoft.com somewhere. The base SDK is over 110 Mb!!! bTry http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ or search for "Platform SDK" on microsoft.com

IanB

MrPiercer
24th June 2003, 16:36
Originally posted by IanB
MrPiercer,

You only need DirectX 8.1 (let this thread know how it compiles with DX9)




It compiled perfectly with Visual Studio .NET 7.0 and both the accompanying MS compiler and with Intel C++ 7.1 Enterprise compiler. I used the Core SDK from MSDN downloaded 2003-03-23 and the DirectX 9.0 SDK from MSDN, same date.

I also tried with compiler flag optimized for Pentium 4.

All the various build logs and resulting DLL files are posted at my website, found on http://www.norrbring.biz/AviSynth

Later!
Anders

IanB
25th June 2003, 15:24
Anders,

Geez, bit lame the Intel compiler can't handle proper shifting for __int64's

> layer.cpp(403): warning #63: shift count is too large
> __int64 thresh=0x0000000000000000 | ((T & 0xFF) <<48)| ((T & 0xFF) <<32)| ((T & 0xFF) <<16)| (T & 0xFF);
> ^
> layer.cpp(403): warning #63: shift count is too large
> __int64 thresh=0x0000000000000000 | ((T & 0xFF) <<48)| ((T & 0xFF) <<32)| ((T & 0xFF) <<16)| (T & 0xFF);
> ^

But, it's dead right about this code, opps!

> focus.cpp
> focus.cpp(756): warning #186: pointless comparison of unsigned integer with zero
> if (luma_thresh>=0) {planes[c++] = PLANAR_Y; planes[c++] = luma_thresh;}
> ^
> focus.cpp(757): warning #186: pointless comparison of unsigned integer with zero
> if (chroma_thresh>=0) { planes[c++] = PLANAR_V;planes[c++] =chroma_thresh;planes[c++] = PLANAR_U;planes[c++] =chroma_thresh;}
^
Swings and roundabouts....

IanB

MrPiercer
25th June 2003, 15:46
Originally posted by IanB
Anders,

Geez, bit lame the Intel compiler can't handle proper shifting for __int64's

But, it's dead right about this code, opps!

Swings and roundabouts....
IanB

Heehe... :) Well, I haven't done squat about ANY other setting than shifting btw. compilers and PII / P4 optimization in the project properties in VS. Perhaps some other settings would help out? I don't know, I'm certainly no wiz with the Intel compiler, I got it just last week... (And YES, I hate manuals!)

Anyway, is there something I can do to help out, just let me know!

One most disturbing thing I noticed is that if I use VS' "Configuration manager" to add a config other than the "release", "debug" and "profile" (Well, I made a new, called it "P4" and chose "Copy settings" and copied from "Release") then the project won't compile!? Are there any directory paths hardcoded in the code instead of using VS' variables?

Later! :cool:
Anders.

sh0dan
30th June 2003, 09:19
Originally posted by IanB
But, it's dead right about this code, opps!

> focus.cpp
> focus.cpp(756): warning #186: pointless comparison of unsigned integer with zero
> if (luma_thresh>=0) {planes[c++] = PLANAR_Y; planes[c++] = luma_thresh;}
> ^
> focus.cpp(757): warning #186: pointless comparison of unsigned integer with zero
> if (chroma_thresh>=0) { planes[c++] = PLANAR_V;planes[c++] =chroma_thresh;planes[c++] = PLANAR_U;planes[c++] =chroma_thresh;}
^
Swings and roundabouts....

IanB

Good one ;) I'll fix!

I should probably also have a look at the int64 -> int casts - most likely all of them are audio functions. "audio.cpp" should have another workover one of these days.

geoffwa
22nd July 2003, 12:46
On a related compiling note, when I try to compile code for a filter that includes the isse_scenechange assembler functions used in Avisynth I get the following error:


psadbw mm0,mm1

warning C4405 (http://msdn.microsoft.com/library/en-us/vccore/html/C4405.asp): 'mm0' : identifier is reserved word
error C2400 (http://msdn.microsoft.com/library/en-us/vccore/html/C2400.asp): inline assembler syntax error in 'opcode'; found 'mm0'

(using Visual C++ SP5, Processor Pack, Feb '03 Core SDK)

Switching the processor build target in my project settings to Pentium Pro or Blend doesn't have any effect. Can someone point out where I'm going wrong?

tempetai
3rd August 2003, 19:35
Hi all,

I have installed SP5, Processor Pack and complete Platform SDK. But, when I tried to compile AVISYNTH, I got this error:

error C2065: 'IIPDVDec' : undeclared identifier

Can anyone tell me, what I have missed here.

thanks.

WarpEnterprises
4th August 2003, 05:52
Did you install DirectX SDK?

tempetai
4th August 2003, 09:36
Originally posted by WarpEnterprises
Did you install DirectX SDK?

OK... This is the thing that I have missed... Thanks WarpEnterprises...

tempetai
5th August 2003, 18:38
I have installed DXSDK, but now I got these errors:

Linking...
Creating library Profile/avisynth.lib and object Profile/avisynth.exp
softwire_helpers.obj : error LNK2001: unresolved external symbol "public: void * __thiscall SoftWire::Assembler::acquire(void)" (?acquire@Assembler@SoftWire@@QAEPAXXZ)
.....


avisynth.dll - 79 error(s), 0 warning(s)

Please help.

WarpEnterprises
6th August 2003, 06:08
I think your include path doesn't include the LIB directory in the AviSynth sources (there are nowadays some LIBs necessary - Softwire, image reader libs,...)

tempetai
6th August 2003, 09:13
I've add the avisynth\distrib\include and lib into directories tab. But still no different. But I notice some improvement when I put softwire.lib and devil.lib into link tab of project preference. The error turn to 65 from 79. But still a lot of error.

Please help.

tempetai
7th August 2003, 02:27
What is the active configuration that you guys is using? Mine was defaulted to Win32 Profile. Does this make any different?

Sorry to ask. I'm very new in VC++ environment.

IanB
7th August 2003, 07:34
Originally posted by tempetai
What is the active configuration that you guys is using? Mine was defaulted to Win32 Profile. Does this make any different?

Sorry to ask. I'm very new in VC++ environment.

Profiles simply provide a convienient means to select build options, like "/D DEBUG". Look under "Project Settings" to see what options are actually part of each profile.

The standard profiles are :-

"Win32 Debug" does a full debug build and uses debug versions of the libraries. (Maximum checking, slower, development)

"Win32 Profile" does a release style build but links with profiling libraries. (check with Sh0dan how to make use of these tools)

"Win32 Release" does a full release build and uses full release grade libraries. (Maximum speed, for normal use)

IanB

tempetai
8th August 2003, 02:31
I'm now succesfully compiling the avisynth in any configuration. I just have to make sure that the softwire.lib and devil.lib are in the list and set the link option to /NODEFAULTLIB:"LIBC".

Softwire is cool...

sh0dan
8th August 2003, 08:54
@IanB: Actually I have never used the "Profile Configuration". For profiling, it is possible to use the Release builds. I don't know who created the Profile Conf, but it just left it there, if anyone uses it.

It should probably just be removed, unless someone objects.

Yes - SoftWire rocks!

tempetai
8th August 2003, 09:47
I have no objection... Cause me two days trouble...

WarpEnterprises
8th August 2003, 12:29
add some hours from me ...