Skip to main content
GameDev.net gamedev.net
🔒 Locked

Linking Errors are Killing Me

Started by nickwinters Jun 28, 2004 at 2:07 PM 4 replies 450+ views
Original Post
nickwinters
nickwinters
I have the following block of code:
D3DXMATRIXA16 matWorld;
    D3DXMatrixIdentity(&matWorld);
    device->SetTransform(D3DTS_WORLD, &matWorld);

    D3DXVECTOR3 vEyePt(0.0f, 1.0f, -3.0f);
    D3DXVECTOR3 vLookatPt(0.0f, 0.0f, 0.0f);
    D3DXVECTOR3 vUpVec(0.0f, 1.0f, 0.0f);
    D3DXMATRIXA16 matView;
    D3DXMatrixLookAtLH(&matView, &vEyePt, &vLookatPt, &vUpVec);
    device->SetTransform(D3DTS_VIEW, &matView);

    D3DXMATRIXA16 matProj;
    D3DXMatrixPerspectiveFovLH(&matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f);
    device->SetTransform(D3DTS_PROJECTION, &matProj);
This is the only place I'm using LookAtLH and PerspectiveFovLH. I've include in this classes .h file. For some reason, I get the following linking errors: Renderer.obj : error LNK2001: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 Renderer.obj : error LNK2001: unresolved external symbol _D3DXMatrixLookAtLH@16 Do I need to include some other .h files? Thanks. -Nick
Saandman
Saandman
Have you linked your project with the accompaning d3dx9 lib?
________pro.gram.mer - an organism that turns caffeine into code
ms291052
ms291052
At the top of your main.cpp (or winmain.cpp or whatever) put the following:

#pragma comment(lib, "d3d9.lib")#pragma comment(lib, "d3dx9.lib")
Promit
Promit
Alternately, add those in your project settings, under the Linker tab.


Or, simply locate the lib files and add them to your project (same way you add a source file).
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
rohitgonsalves
rohitgonsalves
Otherwise simple thing;

If you create your project from directx 9 apllication wizard,
The wizard always puts lib path and makes appropriate settings.
So no worry and you will never get the linking errors as these.
MOV AL, 0x00MOV AL, ME

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.