VC++ strange error
Hi there,
I'm trying to develop a DirectShow filter. I developed the filter and compiled and run successfuly. However, when I tried to add an feature which requires to use CFile class (MFC), VC++ can not link the project, and gives errors like that:
Linking...
Creating library Debug_Unicode/ezrgb24.lib and object Debug_Unicode/ezrgb24.exp
ezrgb24.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
ezrgb24.obj : error LNK2001: unresolved external symbol "int __stdcall AfxAssertFailedLine(char const *,int)" (?AfxAssertFailedLine@@YGHPBDH@Z)
ezrgb24.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CFile::~CFile(void)" (??1CFile@@UAE@XZ)
ezrgb24.obj : error LNK2001: unresolved external symbol "public: __thiscall CFile::CFile(void)" (??0CFile@@QAE@XZ)
.\Debug_Unicode\ezrgb24.ax : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.
I included these headers in the folowing order:
#include <afx.h>
#include <windows.h>
#include <streams.h>
#include <initguid.h>
#if (1100 > _MSC_VER)
#include <olectlid.h>
#else
#include <olectl.h>
#endif
#include "EZuids.h"
#include "iEZ.h"
#include "EZprop.h"
#include "EZrgb24.h"
#include "resource.h"
What I wrote in the code was just "CFile fs;":)
I've tried all tricks (including adding stdafx files),but cannot solve the problem. Moreover, I've created an MFC supported static library and move file processing codes to that library. Then I've tried to create an MFC supported console application and tried to use this library beside my filter application, but it gives the same error.
Thus, what is the problem? why i cannot use CFile (oh, i need to say that i tried ifstream, but again it did not work) with these applications?(one last note: While developing, VC++ IDE's intelli-sense works and list the members of CFile or ifstream)...
Thanx
|