What's wrong with this simple DirectX prg?
by Sammy · in Technical Issues · 07/23/2006 (8:51 pm) · 4 replies
Hi all,
I just want to print the results of subtraction of two vectors.
I installed VC++ 2005 express and DirectX SDK April 2006
Project types: Visual C++, Win32, Win32 Console Application, Empty project
#include
#include
main(){
D3DXVECTOR3 A3 (5.0f,2.6f,10.f);
D3DXVECTOR3 B3 (2.0f,3.4f,3.0f);
D3DXVECTOR3 C3=A3-B3;
printf("C3=A3-B3=(5.0f,2.6f,10.2)-(2.0f,3.4f,3.0f)=(%f,%f,%f)\n",C3.x,C3.y,c3.z);
return 0;
}
When I run the prg, I get...
------ Build started: Project: start, Configuration: Debug Win32 ------
Compiling...
start.cpp
c:\program files\microsoft directx sdk (april 2006)\include\d3d9.h(40) : fatal error C1083: Cannot open include file: 'objbase.h': No such file or directory
Build log was saved at "file://c:\testdirectx\begin\start\start\Debug\BuildLog.htm"
start - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Configuration settings of VC++ 2005 express:
Tools>options
"Projects and Solutions" > VC++ Directories
(1) Platform: Win32; Show directories for: Include files
C:\Program Files\Microsoft DirectX SDK (April 2006)\Samples\C++\Common
C:\Program Files\Microsoft DirectX SDK (April 2006)\Include
$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(FrameworkSDKDir)include
(2) Platform: Win32; Show directories for: Library files
C:\Program Files\Microsoft DirectX SDK (April 2006)\Lib\x86
$(VCInstallDir)lib
$(VCInstallDir)PlatformSDK\lib
$(FrameworkSDKDir)lib
$(VSInstallDir)
$(VSInstallDir)lib
Any ideas?
Thanks in advance.
:)
I just want to print the results of subtraction of two vectors.
I installed VC++ 2005 express and DirectX SDK April 2006
Project types: Visual C++, Win32, Win32 Console Application, Empty project
#include
#include
main(){
D3DXVECTOR3 A3 (5.0f,2.6f,10.f);
D3DXVECTOR3 B3 (2.0f,3.4f,3.0f);
D3DXVECTOR3 C3=A3-B3;
printf("C3=A3-B3=(5.0f,2.6f,10.2)-(2.0f,3.4f,3.0f)=(%f,%f,%f)\n",C3.x,C3.y,c3.z);
return 0;
}
When I run the prg, I get...
------ Build started: Project: start, Configuration: Debug Win32 ------
Compiling...
start.cpp
c:\program files\microsoft directx sdk (april 2006)\include\d3d9.h(40) : fatal error C1083: Cannot open include file: 'objbase.h': No such file or directory
Build log was saved at "file://c:\testdirectx\begin\start\start\Debug\BuildLog.htm"
start - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Configuration settings of VC++ 2005 express:
Tools>options
"Projects and Solutions" > VC++ Directories
(1) Platform: Win32; Show directories for: Include files
C:\Program Files\Microsoft DirectX SDK (April 2006)\Samples\C++\Common
C:\Program Files\Microsoft DirectX SDK (April 2006)\Include
$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(FrameworkSDKDir)include
(2) Platform: Win32; Show directories for: Library files
C:\Program Files\Microsoft DirectX SDK (April 2006)\Lib\x86
$(VCInstallDir)lib
$(VCInstallDir)PlatformSDK\lib
$(FrameworkSDKDir)lib
$(VSInstallDir)
$(VSInstallDir)lib
Any ideas?
Thanks in advance.
:)
#2
Do you have "objbase.h" on your computer? Where is it?
Thanks in advance
07/23/2006 (10:11 pm)
Hi Chris,Do you have "objbase.h" on your computer? Where is it?
Thanks in advance
#3
07/23/2006 (10:58 pm)
I'm not a home at the moment and I use Visual Studio .NET. (I don't know if this makes a difference or not.). I'll have a look into it when I get home but I must confess I can't recall objbase.h from anywhere..
#4
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include"
and change to
int main()
Thanks a lot.
07/24/2006 (1:00 am)
It works. I add this line to VC++ directories - include files"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include"
and change to
int main()
Thanks a lot.
Torque Owner ChrisG
Also your printf has c3.z instead of C3.z