I'm creating a DLL using Visual C++ Express, and when declaring
extern ValveInterfaces* VIFace
inside Required.h
, the compiler is telling me that ValveInterfaces
isn't defined. (I want to expose VIFace
to any file including Required.h
)
Here is the structure of my files:
DLLMain.cpp
#include "Required.h" //required header files, such as Windows.h and the SDK
ValveInterfaces* VIFace;
//the rest of the file
Required.h
#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
Screenshot of errors: https://i.stack.imgur.com/1ZUph.png