4

I'm having annoying linker issues - VS2010 claims it cannot find this file, but it's clearly there, and the path is correct - I'm using other lib's in the same folder that all work no problem. (d3d9.lib, and dinput8.lib) I'm using the February 2010 version of DXSDK (DX9) in case that's relevant. I've even tried copy/pasting the file name so I know I didn't mis-type it. My "Additional Dependencies" line looks like this:

Library.lib;d3d9.lib;dinput8.lib;dxguid.lib;%(AdditionalDependencies)

and the Additional Library Directories line is (for Debug build):

$(DXSDK_DIR)\Lib\;$(SolutionDir)\Debug;%(AdditionalLibraryDirectories)

(Library.lib is my own library, stored in the $(SolutionDir)\Debug folder, or Release for the Release build, but that's not the issue.)

The DXSDK directory contains 2 sub-folders, x64 and x86, and the file exists in both of them, along with the other two libraries which work fine. (Running Windows 7 64bit, so it should be using the first one.) Any ideas?

2 Answers 2

9

EDIT: dinput8 and d3d9 libs might already be in the standard libraries (they are way too old), that's why this worked before.

The directory

$(DXSDK_DIR)\Lib

is not a complete path. It must be either

$(DXSDK_DIR)\Lib\x86

or

$(DXSDK_DIR)\Lib\x64

depending on your target.

If you're building your project for 32-bit environment (go to Configration Manager and check the exact target), the use the x86 subdirectory, otherwise x64.

3
  • Hey, that worked! But this begs the question - how in the world was it working before? The other two lib's are in the same folders and it had no trouble finding them. I assumed it was maybe smart enough to recurse into the appropriate subdirectory or something, but clearly not in this case. Jun 28, 2012 at 21:58
  • 1
    I'm starting to think these obstacles are intentional. Something like "if you can't figure it out then you shouldn't be using this api". OpenCV is another good example of that. Anyhoo, specific to VS2010, the x86 path is the default choice in earlier versions. And common ones, like d3d9.lib are in the Windows SDK lib folder. Jun 28, 2012 at 22:00
  • Added the note to the answer. dinput/d3d9 are very old and might have been in the Windows SDK Jun 28, 2012 at 22:01
0

You should also note, that for Visual Studio Express 2008, 2010 and CodeBlocks you need the path to DirectX at the top of the list of Additional Libraries or whatever it may be called. Use the path with the strange symbols (a virtual path, right?) as well as browse directly to the path in your DirectX installation.

Use Lib/x86 if you are on a 32 but machine, Lib/x64 if on 64 bit. Also be sure to include the Include directory with the DirectX headers.

Not sure if this will help you, but if you are using old DirectX code here is my video tutorial series: http://hi-techheadache.blogspot.com/p/using-old-source-code.html

It will also clarify everything I said because I show you how to setup these IDEs to work with DirectX.

3
  • Link is dead, yo. Article is missing on your new blog.
    – nevelis
    Jan 25, 2014 at 8:03
  • @nevelis and now that link is dead too.
    – bparker
    Jan 3, 2017 at 21:00
  • I THINK this link will have or lead to the same info. I am so sorry I did not keep this updated. I went through some pretty big stuff back then. If you can recall anything that is missing, or if you find any other broken links, please let me know: hi-techheadache.blogspot.com/p/using-old-source-code.html
    – DreamBliss
    Sep 2, 2018 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.