0

I am primeraly a programmer in C++. Recently I started with DirectX11 in C++. The two problems I have is:
1) I get this error when I try to compile my code:

1>------ Build started: Project: t, Configuration: Debug Win32 ------
1>  t.cpp
1>t.obj : error LNK2019: unresolved external symbol _D3DX11CompileFromFileW@44 referenced in function "long __cdecl CompileShaderFromFile(wchar_t *,char const *,char const *,struct ID3D10Blob * *)" (?CompileShaderFromFile@@YAJPA_WPBD1PAPAUID3D10Blob@@@Z)
1>t.obj : error LNK2019: unresolved external symbol _D3D11CreateDeviceAndSwapChain@48 referenced in function "long __cdecl InitDevice(void)" (?InitDevice@@YAJXZ)
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\User\Desktop\t\Debug\t.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

2) When it I compile from DirectX sample browsers example program, the programs starts and closes emediatly.

My code is the example code from the directXSample browser.
I have included the include dir and the lib dir in my project properties.
I am using visual studio 2010 c++ express for programming, and I program on a intel 64 bit.

Any help of how to fix this will be apreciated.
Thanks.

Edited by MasterHacker110

2
Contributors
2
Replies
12
Views
3 Years
Discussion Span
Last Post by MasterHacker110
0

unresolved external means the linker can't find the function. Usually, this means that you're not linking to the right libraries. It's not enough to tell the linker which directories to look in. You also have to tell it which actual library files to use.

Edited by Moschops

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.