Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2004, 04:24 AM
Registered User
 
Join Date: Jul 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
strange error Iguchi Visual Studio 2008 1 April 11th, 2008 06:21 AM
An Strange Error alirezaaali Classic ASP Professional 1 August 16th, 2007 10:03 AM
Strange ERROR (?) myself Classic ASP Basics 16 June 22nd, 2006 06:39 AM
Strange Error !!! NinaWilliam ASP.NET 1.0 and 1.1 Basics 2 May 21st, 2006 01:34 AM
strange error dynamic_iiita Beginning PHP 0 May 22nd, 2005 06:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.