Jump to content
  • Advertisement
Sign in to follow this  

One last linker error,, halp

This topic is 3316 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

RAAAWR I've been banging on my desk for half an hour trying to figure this one out. I'm trying to compile this simple DirectX program in VS08, but the compiler is complaining that the MainLoop function inside loop.cpp has no idea what the HandleMessage function is (which is defined inside main.cpp and declared in global.h). loop.cpp:
#include "global.h"

// only the HandleMessages function is listed here for brevity

bool HandleMessages();

// main loop
void MainLoop(){

       // Input();
       // Logic();
       // Render();

#include "global.h"

bool HandleMessage(){

   static MSG msg;
   if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)){
      if(msg.message == WM_QUIT) return FALSE;
   return TRUE;
// header files
#include <windows.h>
#include <windowsx.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <iostream>
#include "gamewindow.h"

// libraries
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")

// prototypes for
// WinMain.cpp
LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void DisplayWindow(GAMEWINDOW* gw, HINSTANCE hInstance, int nCmdShow);
bool HandleMessages();

// Loop.cpp
void MainLoop();

// Direct3D.cpp
void InitDirect3D(GAMEWINDOW* gw);
void CloseDirect3D();
What is the problem here?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!