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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.