6 Replies - 2747 Views - Last Post: 14 July 2012 - 10:54 AM Rate Topic: -----

#1 Mr_Fraggs  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 89
  • Joined: 17-June 12

Engine linker help

Posted 08 July 2012 - 05:48 PM

Hey everyone, I just have a quick question about a custom game engine.

I'm currently making a game engine using DirectX and Visual Studio Beta 2011. I'm making it with help from the book Advanced 2d Game Programming by Jon Harbour. Now, the file for the engine is a lib file. To make it though, I'm using DirectX 9 SDK. I have the following files included:

#include <d3d9.h>
#include <d3dx9.h>
#include <dxerr9.h>

now, the only one that doesn't work is d3dx9.h. It says the program can't find the file. I haven't actually linked any of the libraries or included any outside files, as the book says you shouldn't have to. Am I reading this wrong, or do I have to include the libs and files for DirectX INTO the engine that i'm making, or into the project that I make WITH the engine? This probably all sounds confusing, but i'm very confused about this myself. Thanks guys!

Is This A Good Question/Topic? 0
  • +

Replies To: Engine linker help

#2 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Engine linker help

Posted 09 July 2012 - 01:14 AM

You will most likely have to link the libraries in additional dependencies, give it a go and see if it works.

What engine are you using anyway?
Was This Post Helpful? 0
  • +
  • -

#3 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Engine linker help

Posted 09 July 2012 - 04:37 AM

If it's not actually finding d3dx9.h itself, it could be for a number of reasons:

1. Your includes path is wrong.
2. Your includes path is correct but the file is missing or elsewhere.
3. Both.

So, you need to verify your include paths via Tools -> Options -> Linker (if I recall correctly) and make sure the file is present.

As one last point, how are you including the file? Are you

#include <d3dx9.h>



or

#include "d3dx9.h"



The former will look in the path(s) set for your environment via linker options in tools with is specific to your environment. The latter will look in your current source files directory specific to your project.

Firstly you need to verify where this header file is.
Was This Post Helpful? 0
  • +
  • -

#4 Mr_Fraggs  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 89
  • Joined: 17-June 12

Re: Engine linker help

Posted 09 July 2012 - 09:31 AM

I'm using the brackets to include the code. It's a custom engine being built around DirectX, more so that I don't have to use DirectX code after I finish this engine. I didn't link anything yet, which is why i'm confused at VS finding the other include files, but not that one. Linking it works, but I wasn't sure if that was what I wanted to do when it came to an engine.
Was This Post Helpful? 0
  • +
  • -

#5 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Engine linker help

Posted 09 July 2012 - 10:58 AM

Have you got multiple versions of DX installed? I can't see how you can be successfully linking if a header can't be found.
Was This Post Helpful? 0
  • +
  • -

#6 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Engine linker help

Posted 10 July 2012 - 01:40 AM

Surely this book didn't include a library without instructions on how to link it?
Was This Post Helpful? 0
  • +
  • -

#7 Mr_Fraggs  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 89
  • Joined: 17-June 12

Re: Engine linker help

Posted 14 July 2012 - 10:54 AM

View Poststayscrisp, on 10 July 2012 - 01:40 AM, said:

Surely this book didn't include a library without instructions on how to link it?


It didn't really include a library, as much as it did make one. I know how to make applications in DirectX, but this book so far had gone over wrapping all the DX code into it's own library, and then exporting it to use in other projects as a .lib file. It just threw me off how the author stated that you don't need to link the DirectX files to the actual .lib project, and shouldn't get any linker errors (which I did). But after linking the DirectX libraries to the project, it compiled fine. I'm not too good with the whole Debug/Release stuff yet, as i'm more concerned with learning the language before I learn about getting working EXEs and all that. Appreciate all the help though, always get it here :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1