मैं विज़ुअल सी ++ एक्सप्रेस का उपयोग कर एक DLL बना रहा हूं, और जब Required.h
अंदर extern ValveInterfaces* VIFace
घोषित करने, संकलक मुझे बता रहा है कि ValveInterfaces
परिभाषित नहीं है।निर्वासन कीवर्ड "लापता प्रकार निर्दिष्टकर्ता"
DLLMain.cpp
#include "Required.h" //required header files, such as Windows.h and the SDK
ValveInterfaces* VIFace;
//the rest of the file
Required.h
:यहाँ (मैं Required.h
सहित किसी भी फाइल करने के लिए VIFace
बेनकाब करना चाहते हैं) मेरी फ़ाइलों की संरचना है
#pragma once
//include Windows.h, and the SDK
#include "ValveInterfaces.h"
extern ValveInterfaces* VIFace; //this line errors
ValveInterfaces.h
#pragma once
#ifndef _VALVEINTERFACES_H_
#define _VALVEINTERFACES_H_
#include "Required.h"
class ValveInterfaces
{
public:
ValveInterfaces(void);
~ValveInterfaces(void);
static CreateInterfaceFn CaptureFactory(char *pszFactoryModule);
static void* CaptureInterface(CreateInterfaceFn fn, char * pszInterfaceName);
//globals
IBaseClientDLL* gClient;
IVEngineClient* gEngine;
};
#endif
त्रुटियों का स्क्रीनशॉट: http://i.imgur.com/lZBuB.png
आप गार्ड शामिल हैं के लिए आरक्षित नाम का उपयोग नहीं करना चाहिए। हालांकि यह अपने विशेष समस्या का कारण नहीं है, यह [इसी तरह की समस्याओं] पैदा कर सकता है (http://stackoverflow.com/questions/3345159/ (कि 'ValveInterfaces.h' के परिपत्र शामिल किए जाने और' Required.h' की वजह से है) इन-सी क्या-तो-विशेष-के बारे में-चाल-ज)। –