I've come to the conclusion that I just can't split a program up into multiple files and come away with it working.
I'm getting linking errors and "not declared" errors all over the place using DevC++
I have the following files:
globals.h
main.h
core.h
main.cpp
core.cpp
Here's the basic contents of the files (removed most of the source since the problem is a linker error).
------------------------------------------------
// GLOBALS.H
#ifndef _GLOBALS_H
#define _GLOBALS_H
extern HWND g_hwndMain;
extern LPSTR g_lpszClassName;
#endif
------------------------------------------------
// MAIN.H
#ifndef _MAIN_H
#define _MAIN_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
------------------------------------------------
// CORE.H
#ifndef _CORE_H
#define _CORE_H
#include "globals.h"
#include "main.h"
// function prototypes
HWND CreateMainWindow(HINSTANCE hInstance);
ATOM RegisterMainClass(HINSTANCE hInstance);
#endif
------------------------------------------------
//MAIN.CPP
#include "globals.h"
#include "main.h"
#include "core.h"
HWND g_hwndMain = NULL;
LPSTR g_lpszClassName = "myCLASSname";
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// THE CODE
}
------------------------------------------------
//CORE.CPP
#include "core.h"
HWND CreateMainWindow(HINSTANCE hInstance)
{
//CODE
}
ATOM RegisterMainClass(HINSTANCE hInstance)
{
//CODE
}
Anyone have any helpful pointers?