Errors in Linking Direct x9 SDK .h &.lib

Good Day
I want to ask this question that many forums cann't answer it...
I installed the Direct x 9 SDK ,and I use Visual Studio.net 2005 ..When I run any

Tutorial(Like Tutorial 2: Vertices ) the following Errors occurs :

-
Error 1 error LNK2019: unresolved external symbol

_Direct3DCreate9@4 referenced in function "long __cdecl InitD3D(struct HWND__ *)"

(?InitD3D@@YAJPAUHWND__@@@Z) Vertices2.obj

Error 2 fatal error LNK1120: 1 unresolved externals

Debug/Vertices2.exe

--

and the out put is:


--
1> Build started: Project: Vertices, Configuration: Debug Win32
1>Linking...
1>Vertices.obj : error LNK2019: unresolved external symbol_Direct3DCreate9@4

referenced in function "long __cdecl InitD3D(struct HWND__ *)" (?

InitD3D@@YAJPAUHWND__@@@Z)
1>Debug/Vertices.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://f:\Learn Vb\C++\Direct

x\Example\Vertices\Debug\BuildLog.htm"
1>Vertices - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

--

many experts suppose that because linking between the (Language) and the (SDK

Headers & Libraries )

what is the problem?

[1772 byte] By [EiasNabhan] at [2007-12-22]
# 1

When you used the MSDN forums search bar and searched for an answer, what did you find?

DavidWeller at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2

In fact when I search the msdn (That with the VS.NET 2005) I cann't find the problem

...But many people suppose that the problem in the linkikng the direct x heades and

libraries
When I use the MSDN forums search bar:Unknown Error

EiasNabhan at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 3

Does this post help answer your problem?

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=595754&SiteID=1

DavidWeller at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 4

Thank you Mr.David and sorry to be late...
After reading your article maybe there are some problems..
First, I use Visual Studio.Net 2005 But I use SDK April 2005 ...DO you think this is the

problem?

Second, When I go to Tools-> Options->Projects and Solutions-> VC++ Diretories
I didn't find $(DXSDK_DIR) & $(DXSDK_DIR) ...Then I select Include files and enter

the path of the .h Files like :
D:\Microsoft Visual Studio 8\VC\PlatformSDK\Include
but the problems still ...
what do you suggests?
And thank you

EiasNabhan at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 5

Effective problems solving is based on moving from the "known" into the "unknown". In this case, nobody can help you effectively resolve your problem until you get the basics down. Follow these steps to help you narrow your problem down:

1) Compile and run a C++ sample from the DirectX SDK. If you have compiler/linker problems, you're almost certainly having problems related to the post I linked earlier. Make the changes like were in the post and try again. Then, if you can't compile a DX sample, we can start working on a solution from there

2) Compile and run a platform SDK sample.

By doing these two things separately, it will help you resolve where the linker problems are lurking.

DavidWeller at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 6


Finally the problem solved ..
While I was reading an article about Dx 8 I noticed the sentece:
//
If you use Microsoft Visual C++ create an empty Win32 project and in the Project

Properties>Linker>Input>Additional Dependencies add d3d8.lib (main direct3d library),

d3dx8.lib (extensions to the main library) and winmm.lib (windows multimedia library).
//

I do this and the first example run ..but the second & third don't.
then I remember your article and this sentence:

//
In some rare cases you might encounter fatal linker errors (CVT1100 and LNK1123).

If you get these messages, remove the .manifest and .rc files from your "Resource

Files" project directory and try again.
//

I do that and now all examples run ^.^
Thank you.
Eias

EiasNabhan at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...