Jump to content

compilation errors


Recommended Posts

Hi,

I am developing managed c++ application in vc++. basically i am developing directx filters but i am facing this problem. i searched on the net but could not find a solution.

Here are the linking errors which i am getting

CaptureFilter error LNK2020: unresolved token (0A000014) new

CaptureFilter error LNK2020: unresolved token (0A000029) delete

These are my c++ command line params

----------------

/O2 /I "C:\DX90SDK\Samples\C++\DirectShow\BaseClasses" /AI "C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\Vellum\Release" /D "WIN32" /D "NDEBUG" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /GS /FAs /Fa".\Release/" /Fo".\Release/" /Fd".\Release/" /W4 /WX /nologo /c /Zi /clr /Gz /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll" /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" /FU "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"

-----------------

and the linker options are

----------------------------

/OUT:"C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\Vellum\Release/CaptureFilter.ax" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Release_Unicode" /DLL /NODEFAULTLIB /DEF:".\CaptureFilter.def" /DEBUG /PDB:"C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\Vellum\Release/CaptureFilter.pdb" /IMPLIB:".\Release/CaptureFilter.lib" /FIXED:No C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Release_Unicode\strmbase.lib quartz.lib vfw32.lib winmm.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "\Dx90sdk\Samples\C++\DirectShow\BaseClasses\Release_Unicode\STRMBASE.lib" "\Program Files\Microsoft DirectX 9.0 SDK (December 2004)\Lib\x86\quartz.lib"

----------------------------

Can you guys tell me why i am getting this error.

ve

Link to comment
Share on other sites


Hi eligeti vinod,

It's me, ursus zeta, from CodeProject. I googled your Link error code and discovered that you've posted all over the Internet. And I can't seem to get into the CodeProject for some reason,...

Anyway, after rereading your C++ command Line and Linker options, I noticed that you used the "/clr" switch, making your DirectShow filter DLL a managed .NET DLL.

I don't know if you are aware of it, but, the DirectShow object libriaries are 'unmanaged' COM libraries; .NET and COM types are NOT compatible. I assumed you were aware of this when I responded to your original post.

When using COM components in .NET applications, the correct technique is to use System.Runtime.Interop which manages the data exchange between the two entities. The COM Interop creates wrappers for all COM types so that they are usable in a .NET environment.

In your case, I think that you want to create an application that is unmanaged (by the Common Language Runtime); in other words, a Win32 application.

Review the Samples that accompany the C++ DirectShow SDK, and you will see that they do not use the /clr switch.

This is from the DirectShow FAQ at the MSDN site:

Will DirectShow ever be accessible through managed code?

There are no current plans to implement a "Managed DirectShow" platform. You can use COM interop to create DirectShow client applications in managed code, but creating filters that depend on the Common Language Runtime (CLR) is not recommended for performance reasons.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...