View Full Version : Compiling AviSynth
WarpEnterprises
22nd September 2003, 21:10
We should mention here what sh0dan wrote as CVS comment:
2003/9/18 16:2:48 - Additional compilation requirements: DirectX Directshow baseclasses, found in the samples directory - add to both library and header directory.
With "samples directory" the directory
DXF\DXSDK\samples\Multimedia\DirectShow\BaseClasses
in the DX-SDK is meant ( I was desparately seeking in the CVS directories :) )
But anyhow: it won't compile, there are many warnings and some LINKER errors:
strmbase.lib(dllentry.obj) : error LNK2005: _DllGetClassObject@12 bereits in main.obj definiert
strmbase.lib(dllentry.obj) : error LNK2005: _DllCanUnloadNow@0 bereits in main.obj definiert
strmbase.lib(dllentry.obj) : warning LNK4006: _DllGetClassObject@12 bereits in main.obj definiert; zweite Definition wird ignoriert
strmbase.lib(dllentry.obj) : warning LNK4006: _DllCanUnloadNow@0 bereits in main.obj definiert; zweite Definition wird ignoriert
Bibliothek Release/avisynth.lib und Objekt Release/avisynth.exp wird erstellt
LINK : warning LNK4098: Standardbibliothek "LIBC" steht in Konflikt mit anderen Bibliotheken; /NODEFAULT:Bibliothek verwenden
strmbase.lib(dllsetup.obj) : error LNK2001: Nichtaufgeloestes externes Symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)
strmbase.lib(dllentry.obj) : error LNK2001: Nichtaufgeloestes externes Symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)
strmbase.lib(dllsetup.obj) : error LNK2001: Nichtaufgeloestes externes Symbol "int g_cTemplates" (?g_cTemplates@@3HA)
strmbase.lib(dllentry.obj) : error LNK2001: Nichtaufgeloestes externes Symbol "int g_cTemplates" (?g_cTemplates@@3HA)
Any ideas? (I added the paths of the mentioned .h and .cpp files as suggested)
sh0dan
24th September 2003, 16:05
Yeah - I had troubles with that one too. I seem to remember I fould an old strmbase.lib (strmbasd.lib in debug mode) somewhere else in my library path. Be sure to only have the one in
DXSDK\samples\Multimedia\DirectShow\BaseClasses\Debug
and
DXSDK\samples\Multimedia\DirectShow\BaseClasses\Release
referenced, and be sure to add both to your Tools/Options/Directories/Libraries I hate the black voodoo with C compilers - especailly linker errors. Unfortunately I can only say that it also took me a few hours to get this compiling on my second machine.
:angry:
WarpEnterprises
2nd October 2003, 16:54
I must be blind but I don't find the LIBs, only .H and .CPP.
Could you put those LIBs somewhere,pls. (if it is not against some rules).
sh0dan
21st October 2003, 19:53
You need to compile the project in the BaseClasses project in Release and debug mode - this will produce the libraries.
WarpEnterprises
13th November 2003, 23:11
has someone else compiled a recent AviSynth version?
I made those libs but still no luck.
now it complains about missing baseclasses in ctlutil.h and many more things.
I can understand that sh0dan can't remember all steps if it is working but everbody else should have the same problem.
I made a clean setup of my system and the problems were quite the same.
ARDA
14th November 2003, 00:03
@ WarpEnterprises
@ sh0dan
quote:
-------------------------------------------------------
has someone else compiled a recent AviSynth version?
-------------------------------------------------------
Yes I've compiled but with some difficulties too.
select in tools - Directories -Library files -
C:\PROGRAM FILES\MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\RELEASE
when you compile in release mode...etc
I've got a usefull dll but I've still a lot of warnings;
mainly with avisynth_c.cpp
35 warning C4273:: inconsistent dll linkage.dllexport assumed.
2 MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\
combase.h(245) : warning C4717: '_imp__InterlockedIncrement'
: recursive on all control paths, function will cause runtime stack overflow
and
avisynth_c.cpp(301) : warning C4700:
local variable 'val' used without having been initialized.
I've searched in google for these warnings and there are a lot of information.
But I must confess I was too lazy to read and look for the solution. And probably
it is a basic matter I don't know
Once more I hope sh0dan could come in our help to understand why all these warnings.
Oh! THANKS AGAIN sh0dan ! for last released !
Thanks in advance ARDA
WarpEnterprises
17th November 2003, 00:14
With the latest CVS I cannot even get to linking.
- I compiled the strmbase.lib / strmbasd.lib
- I added the directories to VC
- compiling avi_source.cpp works
- compiling directshow_source.cpp won't work, the first errors come from the <streams.h> include:
c:\programme\microsoft sdk\samples\multimedia\directshow\baseclasses\wxutil.h(530) : error C2061: Syntaxfehler : Bezeichner 'DWORD_PTR'
c:\programme\microsoft sdk\samples\multimedia\directshow\baseclasses\ctlutil.h(437) : error C2504: 'IBasicVideo2' : Basisklasse undefiniert
as if there is some header files missing.
Am I right that at this point the LIB is not even used?
sh0dan
17th November 2003, 10:46
Originally posted by ARDA
@ WarpEnterprises
@ sh0dan
quote:
-------------------------------------------------------
has someone else compiled a recent AviSynth version?
-------------------------------------------------------
Yes I've compiled but with some difficulties too.
select in tools - Directories -Library files -
C:\PROGRAM FILES\MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\RELEASE
when you compile in release mode...etc
I've got a usefull dll but I've still a lot of warnings;
mainly with avisynth_c.cpp
35 warning C4273:: inconsistent dll linkage.dllexport assumed.
2 MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\
combase.h(245) : warning C4717: '_imp__InterlockedIncrement'
: recursive on all control paths, function will cause runtime stack overflow
and
avisynth_c.cpp(301) : warning C4700:
local variable 'val' used without having been initialized.
I've searched in google for these warnings and there are a lot of information.
But I must confess I was too lazy to read and look for the solution. And probably
it is a basic matter I don't know
Once more I hope sh0dan could come in our help to understand why all these warnings.
Oh! THANKS AGAIN sh0dan ! for last released !
Thanks in advance ARDA
Yes "avisynth_c" added a bunch of warnings. I think I'll have a look soon - and also to fix the crash-on-unload with SmartDecimate. None of the warnings mean anything.
The Directshow warning (_imp__InterlockedIncrement) is unavoidable, but doesn't mean anything. I guess it could be avoided using a #pragma.
@WarpE: I haven't experienced that problem (and you're right - only the header files are used at this stage). I sound quite incredible that it doesn't know what DWORD_PTR is.
WarpEnterprises
18th November 2003, 23:37
It works!
Here is what I did.
- there are some .H files in the MS Visual Studio AND the MS SDK directory, with the ones in the SDK beeing the newer and intended.
- I removed the ...Visual Studio... dirs from the header directories (extras/options...) but some .H-files are NOT present in the SDK
==>
There have to be BOTH entries but the SDK paths and the path to ...SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\DEBUG must come BEFORE the ...Visual Studio paths (for both compiling strmbasd.lib AND AviSynth) to have higher search priority.
Then all you have to do is hoping that all newer .H and .LIB are present and no old one is accidently taken.
My paths are then:
header directories:
C:\Programme\Microsoft SDK\Include
c:\PROGRAMME\MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES
C:\Programme\Microsoft Visual Studio\VC98\INCLUDE
C:\Programme\Microsoft Visual Studio\VC98\MFC\INCLUDE (needed. What is MFC in AviSynth?)
C:\Programme\Microsoft Visual Studio\VC98\ATL\INCLUDE (not needed for AviSynth)
library directories:
C:\Programme\Microsoft SDK\Lib
c:\PROGRAMME\MICROSOFT SDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\DEBUG
C:\Programme\Microsoft Visual Studio\VC98\LIB
C:\Programme\Microsoft Visual Studio\VC98\MFC\LIB (not needed for AviSynth)
Hope this helps and is reproducable.
scmccarthy
30th January 2004, 18:43
WarpEnterprises wrote two interesting questions that were never answered as far as I can tell on this thread. Which runtime library is the right one for a plugin / does it matter / when and how? and What is MFC I use cl.exe /MT to link with libcmt.lib and link.exe /NODEFAULTLIB:msvcrt /NODEFAULTLIB:libc which prevents linking with msvcrt.lib and libc.lib. Otherwise avisynth wants to link with all three versions of the common runtime library. The alternative is to use /FORCE:MULTIPLE to force linking with mutiple versions of the lib functions.
If I compile strmbase.lib with /MT, my linker wants me to use the same threading scheme with avisynth.
Is this right, or do different modules within avisynth need to link with different versions of the runtime?
I would like to see this sticky continue to grow. New compilation issues that crop up on every new version of avisynth. Yet nothings been discussd on this thread since lase November. For instance, I had to comment out two lines in the code to get it to compile://GetSampleEnumPins::GetSampleEnumPins(GetSample* _parent, int _pos); //HRESULT __stdcall GetSampleEnumPins::Next(ULONG cPins, IPin** ppPins, ULONG* pcFetched); in directshow_source.h. I don't believe it matters whether you comment it out of the header or the code file, only that it does not get stated twice.
Finally, are the two files avisynth.opt and avisynth.ncb somehow nessesary to properly compile avisynth? Since I only use the commandline tools, cl.exe, ml.exe, rc.exe, and link.exe, I am not sure whether those files are being used in my compilation. This works fine for standalone filters, but I am still not sure if it works for avisynth itself.
Stephen
esby
19th February 2004, 00:28
I tried to compile avs 2.54 (and suceeded after a ...long time)
If that can help other people,
I'll resume what the thread is saying,
more or less...
(maybe someone should put the infos in the doc?)
relevant information for compiling with VC6
* Install visual studio (containing VC6)
edit: warning the links are for the US version of Visual Studio,
if you are using a non US version, get the specific version...
* Install Visual Studio SP5 (130mb)
http://download.microsoft.com/download/vstudio60ent/SP5/Wideband-Full/WIN98Me/EN-US/VS6sp5.exe
* Install Visual C++ Processor Pack (1mb)
check http://download.microsoft.com/download/vb60ent/Update/6/W9X2KXP/EN-US/vcpp5.exe for links
EDIT: with 2.55 version, the following is no longer needed...
* Install Platform SDK (feb 2003) (31mb for core sdk - minimal)
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
* Install DirectX 8.1 SDK (160mb)
http://www.microsoft.com/downloads/release.asp?ReleaseID=33706
And then you are all good for the needed download...
* Recompile \<DXSDK directory >\samples\Multimedia\DirectShow\BaseClasses\baseclasses.dsp
in order to avoid a nasty bug (in release & debug mode)
* Go in VC++, Tools, options, Directories :
There check .h (headers) section:
a working path order is :
...DXSDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES
...DXSDK\INCLUDE
...MICROSOFT SDK\INCLUDE
...Microsoft Visual Studio\VC98\INCLUDE
...Microsoft Visual Studio\VC98\MFC\INCLUDE
...Microsoft Visual Studio\VC98\ATL\INCLUDE
next step go in Library :
...DXSDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\DEBUG
...DXSDK\SAMPLES\MULTIMEDIA\DIRECTSHOW\BASECLASSES\RELEASE
...DXSDK\lib
...Microsoft SDK\Lib
...Microsoft Visual Studio\VC98\Lib
...Microsoft Visual Studio\VC98\Lib
...Microsoft Visual Studio\VC98\MFC\LIB
then you might be able to compile it :)
I hope it will help somebody...
esby
sh0dan
20th February 2004, 12:47
Just wanted to add a note, that from 2.55 it should be considerably easier to compile AviSynth, as the DirectShow stuff has been moved to a separate plugin.
This eliminates all DirectX stuff and probably the Platform SDK.
You can do a CVS checkout if you want the new code.
esby
11th March 2004, 14:47
Just checked with removing PSDK and not installing DirectX 8.1 SDK here...
2.55 compiled fine on this computer.
Nice work sh0dan :)
esby
scmccarthy
23rd March 2004, 15:43
I thought I'd add something here, I can confirm that the DXDSK and the Platform SDK are not needed anymore. Until now, all we needed from the processor pack was ml.exe for the assembler module. I didn't need it because I used the one from the DDK SDK that I have. There are three header files that are needed now that were not needed before and since they have no corresponding libs all I needed to solve the problem was download them from the internet. They are Intel files emmintrin.h, xmmintrin.h, and mmintrin.h.
Maybe they are part of the Intel compiler, but in that case a lot more people would have trouble.
Normally there would be a corresponding link error following an include error and this would not be enough, but in this case it is. As the names imply they probably define types that make it easier to use mmx or sse2 without out writing in assembler.
This all started because audio.cpp now includes emmintrin.h.
Stephen
esby
23rd March 2004, 23:05
Getting the processor pack is not really a problem,
Its size is inferior to 2mb.
What was dreadful was to get DSDK pack, just to compile one filter...
(and if people did like i did, getting the wrong version pack, it's worse :)
esby
PS: I have no intel compiler installed here, so ... :)
The processor pack is the stumbling block for those of us without access to the bigs boys version of MS VC++.
But then again, maybe if we can't pay then we shouldn't be allowed to play in the big game stakes :p
regards
Simon
esby
24th March 2004, 00:08
damn, so true...
never noticed this 'block' indeed...
then I am wondering if providing the missing file(s) is legal or not...
esby
scmccarthy
30th March 2004, 06:49
After a successful compile, I get an error when trying to play the avs file. Is there a step missing when installing AviSynth.dll or is it a bad compile?
Stephen
stickboy
30th March 2004, 09:46
Did you compile the Release or Debug configuration? I had trouble with the Debug configuration.
scmccarthy
30th March 2004, 16:23
Release, I've been wondering if debug were standard.@echo off
set path=D:\WINDDK\2600\bin\x86;%PATH%
echo compiling:
cl.exe /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /Yc"stdafx.h" /FD /Gs /GF /c .\stdafx.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\core\parser\*.cpp
ren .\core\main.cpp main.c
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\core\*.cpp
ren .\core\main.c main.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /FD /Gs /GF /c .\core\main.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\audio\*.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /FD /Gs /GF /c .\audio\dbesi0.c
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\filters\overlay\*.cpp .\filters\*.cpp .\filters\conditional\*.cpp .\sources\avi\*.cpp
ren .\sources\avi_source.cpp avi_source.c
ren .\sources\source.cpp source.c
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\sources\*.cpp
ren .\sources\avi_source.c avi_source.cpp
ren .\sources\source.c source.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\sources\source.cpp .\convert\*.cpp
mkdir .\Release
move *.obj .\Release
move *.sbr .\Release
ml.exe -c -coff -Cx -Fo.\Release\convert_a.obj .\convert\convert_a.asm
rc.exe /l 0x409 /d "NDEBUG" -Fo.\Release\avisynth.res .\core\avisynth.rc
echo linking:
link.exe /NODEFAULTLIB:libc ../distrib/lib/SoundTouch.lib ../distrib/lib/pfc.lib ../distrib/lib/devil.lib ../distrib/lib/softwire.lib msacm32.lib vfw32.lib kernel32.lib advapi32.lib version.lib user32.lib gdi32.lib ole32.lib uuid.lib winmm.lib oleaut32.lib /nologo /dll /machine:I386 /out:.\Release\avisynth.dll .\Release\*.obj .\Release\avisynth.res
del .\Release\*.obj
del .\Release\*.sbr
..\distrib\upx -9 release\avisynth.dll
copy Release\avisynth.dll C:\WINDOWS\system32
copy ..\distrib\bin\devil.dll C:\WINDOWS\system32That is how I do it; it compiles, but it does not run.
Stephen
P.S. I get a linker warning : all references to 'WINMM.dll' discarded by /OPT:REF
dandragonrage
29th April 2004, 10:11
I just checked out the CVS code. It compiles with VS6. I want to use VS7 (.Net) because the compiler optimizes much better, but I get errors with it.
Linking...
Creating library .\Release/avisynth.lib and object .\Release/avisynth.exp
LINK : warning LNK4098: defaultlib 'LIBC' conflicts with use of other libs; use /NODEFAULTLIB:library
SoundTouch.lib(SoundTouch.obj) : error LNK2001: unresolved external symbol "public: __thiscall std::runtime_error::runtime_error(class std::runtime_error const &)" (??0runtime_error@std@@QAE@ABV01@@Z)
SoundTouch.lib(FIFOSampleBuffer.obj) : error LNK2001: unresolved external symbol "public: __thiscall std::runtime_error::runtime_error(class std::runtime_error const &)" (??0runtime_error@std@@QAE@ABV01@@Z)
SoundTouch.lib(FIRFilter.obj) : error LNK2019: unresolved external symbol "public: __thiscall std::runtime_error::runtime_error(class std::runtime_error const &)" (??0runtime_error@std@@QAE@ABV01@@Z) referenced in function "public: virtual void __thiscall FIRFilter::setCoefficients(float const *,unsigned int,unsigned int)" (?setCoefficients@FIRFilter@@UAEXPBMII@Z)
SoundTouch.lib(SoundTouch.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::runtime_error::~runtime_error(void)" (??1runtime_error@std@@UAE@XZ)
SoundTouch.lib(FIFOSampleBuffer.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::runtime_error::~runtime_error(void)" (??1runtime_error@std@@UAE@XZ)
SoundTouch.lib(FIRFilter.obj) : error LNK2001: unresolved external symbol "public: virtual __thiscall std::runtime_error::~runtime_error(void)" (??1runtime_error@std@@UAE@XZ)
SoundTouch.lib(SoundTouch.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) const std::runtime_error::`vftable'" (__imp_??_7runtime_error@std@@6B@)
SoundTouch.lib(FIFOSampleBuffer.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) const std::runtime_error::`vftable'" (__imp_??_7runtime_error@std@@6B@) referenced in function "private: void __thiscall FIFOSampleBuffer::ensureCapacity(unsigned int)" (?ensureCapacity@FIFOSampleBuffer@@AAEXI@Z)
SoundTouch.lib(FIRFilter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) const std::runtime_error::`vftable'" (__imp_??_7runtime_error@std@@6B@)
SoundTouch.lib(SoundTouch.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) private: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (__imp_?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE_NI_N@Z) referenced in function "public: void __thiscall SoundTouch::setChannels(unsigned int)" (?setChannels@SoundTouch@@QAEXI@Z)
SoundTouch.lib(FIFOSampleBuffer.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (__imp_?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE_NI_N@Z)
SoundTouch.lib(FIRFilter.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: bool __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Grow(unsigned int,bool)" (__imp_?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAE_NI_N@Z)
SoundTouch.lib(SoundTouch.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Eos(unsigned int)" (__imp_?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z) referenced in function "public: virtual void __thiscall SoundTouch::putSamples(float const *,unsigned int)" (?putSamples@SoundTouch@@UAEXPBMI@Z)
SoundTouch.lib(FIFOSampleBuffer.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Eos(unsigned int)" (__imp_?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXI@Z)
SoundTouch.lib(SoundTouch.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Tidy(bool)" (__imp_?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z) referenced in function "public: virtual void __thiscall SoundTouch::putSamples(float const *,unsigned int)" (?putSamples@SoundTouch@@UAEXPBMI@Z)
SoundTouch.lib(FIFOSampleBuffer.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Tidy(bool)" (__imp_?_Tidy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEX_N@Z)
.\Release/avisynth.dll : fatal error LNK1120: 6 unresolved externals
It would really be awesome if someone could get this working.
scmccarthy
29th April 2004, 17:31
I have to uselink.exe /NODEFAULTLIB:libc to get the cvs to compile.
It compiles fine, but still does not work. Does anyone know how to install avisynth.dll? Or is something wrong with the way I compile it?
Here is the batch file I use:@echo off
set path=D:\WINDDK\2600\bin\x86;%PATH%
REM TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
REM PROP AllowPerConfigDependencies 0
REM PROP Scc_ProjName ""
REM PROP Scc_LocalPath ""
REM PROP Use_MFC 0
REM PROP Use_Debug_Libraries 0
REM PROP Output_Dir "Release"
REM PROP Intermediate_Dir "Release"
REM PROP Target_Dir ""
echo compiling:
REM ADD BASE cl.exe /nologo /MT /W3 /wd4005 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_EXPORTS" /YX /FD /c
cl.exe /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /Yc"stdafx.h" /FD /Gs /GF /c .\stdafx.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\core\parser\*.cpp
ren .\core\main.cpp main.c
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\core\*.cpp
ren .\core\main.c main.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /FD /Gs /GF /c .\core\main.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\audio\*.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /FD /Gs /GF /c .\audio\dbesi0.c
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\filters\overlay\*.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\filters\*.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\filters\conditional\*.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\sources\avi\*.cpp
ren .\sources\avi_source.cpp avi_source.c
ren .\sources\source.cpp source.c
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\sources\*.cpp
ren .\sources\avi_source.c avi_source.cpp
ren .\sources\source.c source.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\sources\source.cpp
cl.exe /nologo /G6 /MD /W3 /wd4005 /GX /O2 /Ob2 /D "NDEBUG" /D "INC_OLE2" /D "STRICT" /D "WIN32" /D "_WIN32" /D "_MT" /D "_DLL" /D "_MBCS" /D "_USRDLL" /D "AVISYNTH_C_EXPORTS" /Fr /Yu"stdafx.h" /FD /Gs /GF /c .\convert\*.cpp
REM mkdir .\Release
move *.obj .\Release
move *.sbr .\Release
ml.exe -c -coff -Cx -Fo.\Release\convert_a.obj .\convert\convert_a.asm
rc.exe /l 0x409 /d "NDEBUG" -Fo.\Release\avisynth.res .\core\avisynth.rc
echo linking:
REM ADD BASE link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
link.exe /NODEFAULTLIB:libc ../distrib/lib/SoundTouch.lib ../distrib/lib/pfc.lib ../distrib/lib/devil.lib ../distrib/lib/softwire.lib msacm32.lib vfw32.lib kernel32.lib advapi32.lib version.lib user32.lib gdi32.lib ole32.lib uuid.lib winmm.lib oleaut32.lib /nologo /dll /machine:I386 /out:.\Release\avisynth.dll .\Release\*.obj .\Release\avisynth.res
del .\Release\*.obj
del .\Release\*.sbr
..\distrib\upx -9 release\avisynth.dll
REM copy Release\avisynth.dll C:\WINDOWS\system32
REM copy ..\distrib\bin\devil.dll C:\WINDOWS\system32
Stephen
dandragonrage
29th April 2004, 22:29
It compiles file? Does avisynth\distrib\bin\avisynth.dll exist, then?
scmccarthy
29th April 2004, 23:13
Oh yes, but if I do the last two lines where it copies the two files to system32, I get an error when I try an avs file.
Stephen
Bidoche
30th April 2004, 08:55
@dandragonrage
All your missing externals come from the standard template library which must be included with .NET. (as with every C++ compiler)
I do not know if you have to link it as a lib or if mere includes will do.
Anyway you can try :
#include <string>
#include <stdexcept>
dandragonrage
30th April 2004, 12:21
None of that worked. I also tried point VC.net to the lib directory of VC6 and copying the linker library include stuff over but that also did not help.
scmccarthy
30th April 2004, 19:54
@dandragonrage
You are not linking with the C runtime library due to the conflict with libc.lib. Using NODEFAULTLIB would get rid of the error messages, but I am not certain if that would solve the problem since it does not work for me.
Stephen
dandragonrage
30th April 2004, 23:25
Using nodefaultlib gets rid of the warning but doesn't help the errors.
scmccarthy
1st May 2004, 16:35
@dandragonrage,
Maybe the lib environment variable points to a version of libcmt.lib that is incompatible with the includes you use.
Or maybe the version of C runtime library you link with is not the same one that SoundTouch.lib links to. Really the second answer is more likely.
Stephen
ada2001
3rd May 2004, 22:19
I have the same compile errors as dandragonrage. I'm using VSNet 2003. I've tried (of course) using the /NODEFAULTLIB:C option to no avail. Has anyone else been able to get a working VS .NET 2003 build?
Thanks!
ada2001
3rd May 2004, 22:56
When I compiled the SoundTouch sources using VS .NET 2003 and then using the subsequent SoundTouch.lib to build AviSynth CVS, I get the following errors:
Linking...
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in SoundTouch.lib(SoundTouch.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in SoundTouch.lib(SoundTouch.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in SoundTouch.lib(SoundTouch.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in SoundTouch.lib(SoundTouch.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in SoundTouch.lib(SoundTouch.obj)
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in SoundTouch.lib(SoundTouch.obj)
msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in SoundTouch.lib(SoundTouch.obj); second definition ignored
msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in SoundTouch.lib(SoundTouch.obj); second definition ignored
msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) already defined in SoundTouch.lib(SoundTouch.obj); second definition ignored
msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::max_size(void)const " (?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in SoundTouch.lib(SoundTouch.obj); second definition ignored
msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::erase(unsigned int,unsigned int)" (?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z) already defined in SoundTouch.lib(SoundTouch.obj); second definition ignored
msvcprt.lib(MSVCP71.dll) : warning LNK4006: "public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::size(void)const " (?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ) already defined in SoundTouch.lib(SoundTouch.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
I'm not terribly familiar with VS anything, so anyone else have any ideas?
Thanks!
Bidoche
4th May 2004, 18:03
did you try to not link vs msvcprt.lib ?
It's weird anyway, as far as my understanding goes, I thought that STL code would not be exported from any lib...
I suggest you try replacing VC7.1 standard library by STLPort from www.stlport.org (download and set it in your include path) and recompile.
ada2001
6th May 2004, 21:14
Yeah, it's deeply wierd. I had tried unlinking msvcprt.lib and it really messed things up so I figured the previous errors were probably easier to fix. When I get some time, I'll start looking at this again.
Bidoche
14th May 2004, 18:52
I think I got the solution this time :
Some guy posted about the same probleme in the forums at www.stlport.org.
He finally fixed it by creating a empty project and importing his files into it, rather than using a conversion from VC6.
scmccarthy
1st June 2004, 05:03
I can compile AviSynth, but VirtualDubMod gives me an avi import filter error and windows media player complains the class is not registered.
Stephen
Wilbert
4th July 2004, 22:03
I finally installed the professional edition (and the rest of the stuff). But, I also can't get it to work. When compiling I get the following message
--------------------Configuration: avisynth - Win32 Release--------------------
Linking...
Creating library Release/avisynth.lib and object Release/avisynth.exp
SoundTouch.lib(FIRFilter.obj) : fatal error LNK1202: "F:\CompilingPlugins\avisynth_oud\src\Release\vc60.pdb" is missing
debugging information for referencing module
Error executing link.exe.
avisynth.dll - 1 error(s), 0 warning(s)
The link settings:
/NODEFAULTLIB:libc ../distrib/lib/SoundTouch.lib ../distrib/lib/pfc.lib ../distrib/lib/devil.lib
../distrib/lib/softwire.lib msacm32.lib vfw32.lib kernel32.lib advapi32.lib version.lib user32.lib gdi32.lib ole32.lib
uuid.lib winmm.lib oleaut32.lib
What am I doing wrong?
stickboy
4th July 2004, 22:37
I've been getting the same problem trying to build the Release version...
@WilbertWhat am I doing wrong?Nothing! The release SoundTouch library has been built without symbols (DAMN!!):angry: You will have to build release avisynth.dll without symbols until some kind soul rebuilds it and puts it in CVS.
Look in the [link] tabpane of properties/settings turn off symbols:mad:
IanB
Wilbert
6th July 2004, 20:26
Sorry, I can't find that option :D
Somewhere under Project -> Settings -> C/C++ -> Preprocessor -> check "Undefine all symbols"
I guess that's the wrong one, because that doesn't work.
stickboy
7th July 2004, 05:55
In MSVC6:
Project > Settings > Link > Debug, uncheck "Debug info".
scmccarthy
9th July 2004, 15:50
A thought, must AviSynth be compiled only as a debug release? Does it work as a regular release?
Stephen
stickboy
9th July 2004, 18:33
IIRC the debug DLL is couple megabytes in size... the release DLL is only several hundred kilobytes.
Clearly the release version is the one that's distributed.
Awhile back, though, I couldn't get the debug DLL working... maybe that's what you're thinking of?
Wilbert
9th July 2004, 18:39
Just crab the latest source from CVS. It works now (release build) without doing anything special. Sh0dan updated the project file a few days ago.
scmccarthy
18th July 2004, 04:12
I continue to get the same Windows Media Player error:Class not registered (Error=80040154)
Stephen
tritical
21st July 2004, 22:08
I can confirm it is much easier to get AviSynth to compile now vs. the last time I tried :), especially with vs.net. It worked pretty much straight away, converted to vc 7 project on load (first time that has never screwed up for me :D). Few errors from the soundtouch lib, I didn't try IanB's suggestion for it but just compiled the soundtouch lib myself and everything worked fine. No errors on compiling avisynth, but 179 warnings... mainly all small stuff like type conversion - possible loss of data, no emms at end of asm function, etc... That was using vs.net 2002, directx 9 sdk, platform sdk, but I guess the directx sdk and platform sdk are no longer needed.
tolgae
7th January 2005, 09:29
I am trying to compile 2.5.5 sources (and I tried the old ones, the same error happens). I am getting errors in the convert_a.asm file. All of them look similar to this one:
convert_a.asm(258) : error A2070: invalid instruction operands
YUV2RGB_INNER_LOOP(8): Macro Called From
YUV2RGB_PROC(33): Macro Called From
I am using VC7.1. Seeing the recent posts that mentions the SDKs are not necessary anymore, I did not install anything extra. Probably it is something very simple but even after reading all the posts in this thread, I am not seeing it (I am no good with asm).
Any help is appreciated.
esby
7th January 2005, 13:40
afik,
people succeeded compiling avs 2.55 with vc6.x, not with vc7.X.
esby
tolgae
7th January 2005, 16:39
Originally posted by esby
afik,
people succeeded compiling avs 2.55 with vc6.x, not with vc7.X.
esby
The post right above mine (from tritical) indicates it is possible to compile with VC7.x. I was hoping a step-by-step guide on how to do it, like
1- Install VC7.x
2- Download source.
3- Download ??? (if necessary)
4- Open project.
5- ???
6- Build
tritical
8th January 2005, 09:38
It is definitely possible, just did it last night :D. It should work fine as long as you have the Platform sdk installed. I'm not really sure if you need the directx sdk anymore or not (I think not). But for me it works fine just doing this:
1.) download source
2.) open workspace and convert to vc 7 project
3.) set configuration to release
4.) build project
EDIT: About needing the platform sdk, I'm not sure if you do or don't. I have it installed and the above process works fine for me.
WarpEnterprises
8th January 2005, 22:19
the DX SDK is not necessary. It was needed only for DirectShowSource which is now a plugin.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.