DirectX 10 on Visual 2012

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
This is my code:
#include <iostream><br/>
#include <D3D10.h><br/>
#include <D3DX10math.h><br/>
<br/>
using namespace std; <br/>
<br/>
<br/>
// Overload the "<<" operators so that we can uyse cout to<br/>
// output D3DXVECTOR3 objects.<br/>
<br/>
ostream& operator<<(ostream& os, D3DXVECTOR3& v)<br/>
{<br/>
os << "(" << v.x << ", " << v.y << ", " << v.z << ")";<br/>
return os;<br/>
}<br/>
<br/>
int main()<br/>
{<br/>
// Using constructor, D3DXVECTOR3(FLOAT X, FLOAT Y, FLOAT Z);<br/>
D3DXVECTOR3 u(1.0f, 2.0f, 3.0f);<br/>
<br/>
// Using constructor, D3DXVECTOR(CONST FLOAT *);<br/>
float x[3] = {-2.0f, 1.0f, -3.0f};<br/>
D3DXVECTOR3 v(x);<br/>
<br/>
// Using constructor, D3DXVECTOR3() {}<br/>
D3DXVECTOR3 a, b, c, d, e;<br/>
<br/>
// Vector addition: D3DXVECTOR3 operator +<br/>
a = u + v;<br/>
<br/>
// Vector substraction: D3DXVECTOR3 operator -<br/>
b = u - v;<br/>
<br/>
// Scalar multiplication: D3DXVECTOR3 operator *<br/>
c = u * 10;<br/>
<br/>
// ||u||<br/>
float L = D3DXVec3Length(&u);<br/>
<br/>
// d = u / ||u||<br/>
D3DXVec3Normalize(&d, &u);<br/>
<br/>
// s = u dot v<br/>
float s = D3DXVec3Dot(&u, &v);<br/>
<br/>
// e = u x v<br/>
D3DXVec3Cross(&e, &u, &v);<br/>
<br/>
cout << "u = " << u << endl;<br/>
cout << "v = " << v << endl;<br/>
cout << "a = u + v = " << a << endl;<br/>
cout << "b = u - v = " << b << endl;<br/>
cout << "c = u * 10 = " << b << endl;<br/>
cout << "d = u / ||u|| = " << d << endl;<br/>
cout << "e = u x v = " << e << endl;<br/>
cout << "L = ||u|| = " << L << endl;<br/>
cout << "s = u.v = " << s << endl;<br/>
<br/>
return 0;<br/>
<br/>
}
And this is my Output:
1>------ Rebuild All started: Project: Part1 - Vector Operations, Configuration: Debug Win32 ------<br/>
1>Build started 9/24/2012 9:57:38 PM.<br/>
1>_PrepareForClean:<br/>
1> Deleting file "DebugPart1 - Vector Operations.lastbuildstate".<br/>
1>InitializeBuildStatus:<br/>
1> Touching "DebugPart1 - Vector Operations.unsuccessfulbuild".<br/>
1>ClCompile:<br/>
1> main.cpp<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(12): warning C4005: DXGI_STATUS_OCCLUDED : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49449) : see previous definition of DXGI_STATUS_OCCLUDED<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(13): warning C4005: DXGI_STATUS_CLIPPED : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49458) : see previous definition of DXGI_STATUS_CLIPPED<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(14): warning C4005: DXGI_STATUS_NO_REDIRECTION : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49467) : see previous definition of DXGI_STATUS_NO_REDIRECTION<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(15): warning C4005: DXGI_STATUS_NO_DESKTOP_ACCESS : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49476) : see previous definition of DXGI_STATUS_NO_DESKTOP_ACCESS<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(16): warning C4005: DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49485) : see previous definition of DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(17): warning C4005: DXGI_STATUS_MODE_CHANGED : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49494) : see previous definition of DXGI_STATUS_MODE_CHANGED<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(18): warning C4005: DXGI_STATUS_MODE_CHANGE_IN_PROGRESS : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49503) : see previous definition of DXGI_STATUS_MODE_CHANGE_IN_PROGRESS<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(21): warning C4005: DXGI_ERROR_INVALID_CALL : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49518) : see previous definition of DXGI_ERROR_INVALID_CALL<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(22): warning C4005: DXGI_ERROR_NOT_FOUND : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49527) : see previous definition of DXGI_ERROR_NOT_FOUND<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(23): warning C4005: DXGI_ERROR_MORE_DATA : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49536) : see previous definition of DXGI_ERROR_MORE_DATA<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(24): warning C4005: DXGI_ERROR_UNSUPPORTED : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49545) : see previous definition of DXGI_ERROR_UNSUPPORTED<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(25): warning C4005: DXGI_ERROR_DEVICE_REMOVED : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49554) : see previous definition of DXGI_ERROR_DEVICE_REMOVED<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(26): warning C4005: DXGI_ERROR_DEVICE_HUNG : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49563) : see previous definition of DXGI_ERROR_DEVICE_HUNG<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(27): warning C4005: DXGI_ERROR_DEVICE_RESET : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49573) : see previous definition of DXGI_ERROR_DEVICE_RESET<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(28): warning C4005: DXGI_ERROR_WAS_STILL_DRAWING : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49582) : see previous definition of DXGI_ERROR_WAS_STILL_DRAWING<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(29): warning C4005: DXGI_ERROR_FRAME_STATISTICS_DISJOINT : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49592) : see previous definition of DXGI_ERROR_FRAME_STATISTICS_DISJOINT<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(30): warning C4005: DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49601) : see previous definition of DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(31): warning C4005: DXGI_ERROR_DRIVER_INTERNAL_ERROR : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49611) : see previous definition of DXGI_ERROR_DRIVER_INTERNAL_ERROR<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(32): warning C4005: DXGI_ERROR_NONEXCLUSIVE : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49620) : see previous definition of DXGI_ERROR_NONEXCLUSIVE<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(33): warning C4005: DXGI_ERROR_NOT_CURRENTLY_AVAILABLE : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49629) : see previous definition of DXGI_ERROR_NOT_CURRENTLY_AVAILABLE<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(34): warning C4005: DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49639) : see previous definition of DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)includedxgitype.h(35): warning C4005: DXGI_ERROR_REMOTE_OUTOFMEMORY : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49648) : see previous definition of DXGI_ERROR_REMOTE_OUTOFMEMORY<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)included3d10.h(608): warning C4005: D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49793) : see previous definition of D3D10_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS<br/>
1>f:program files (x86)microsoft directx sdk (june 2010)included3d10.h(609): warning C4005: D3D10_ERROR_FILE_NOT_FOUND : macro redefinition<br/>
1> c:program files (x86)windows kits8.0includesharedwinerror.h(49802) : see previous definition of D3D10_ERROR_FILE_NOT_FOUND<br/>
1>main.obj : error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function _main<br/>
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup<br/>
1>D:IOT-2DAE Game DevSemester 1Graphics Programming 1Book ProjectsChapter1Part1 - Vector OperationsDebugPart1 - Vector Operations.exe : fatal error LNK1120: 2 unresolved externals<br/>
1><br/>
1>Build FAILED.<br/>
1><br/>
1>Time Elapsed 00:00:01.98<br/>
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I am in console Linker Substystem so that is not the problem. =S
Also if i put the platform toolset to 2010, i only get:<br/>
1>------ Rebuild All started: Project: Part1 - Vector Operations (Visual Studio 2010), Configuration: Debug Win32 ------<br/>
1>Build started 9/24/2012 10:04:55 PM.<br/>
1>_PrepareForClean:<br/>
1> Deleting file "DebugPart1 - Vector Operations.lastbuildstate".<br/>
1>InitializeBuildStatus:<br/>
1> Touching "DebugPart1 - Vector Operations.unsuccessfulbuild".<br/>
1>ClCompile:<br/>
1> main.cpp<br/>
1>main.obj : error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function _main<br/>
1>D:IOT-2DAE Game DevSemester 1Graphics Programming 1Book ProjectsChapter1Part1 - Vector OperationsDebugPart1 - Vector Operations.exe : fatal error LNK1120: 1 unresolved externals<br/>
1><br/>
1>Build FAILED.<br/>
1><br/>
1>Time Elapsed 00:00:05.48<br/>
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========<br/>
<br/>

View the full article
 
Back
Top