Advertisement

DX9 annoyingly simplistic question

Started by December 30, 2002 04:26 PM
5 comments, last by Fuzztrek 21 years, 10 months ago
Hi all, I''m converting my dx8 engine to dx9, and I *think* I''ve correctly set up my compiler (vs.net) so it looks for dx9 files instead of dx8. Anyway, it doesn''t recognize Direct3DCreate9:
quote: if((m_lpD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL){ LogError("
  • Unable to create D3D9 interface."); return E_FAIL; }
  • quote: error C2065: ''Direct3DCreate9'' : undeclared identifier
    I''m including d3d9.h, d3dx9.h and the d3d9 libs. Anyone know what''s wrong or how I can fix the problem? Thanks in advance!
    Hm. The problem seems to have gone away. I now get a bunch of errors to do with dx files (redefinitions, etc.) I think it has something to do with my includes or precompiled header. Here they are.. if anyone can figure out what''s wrong could you please tell me? :|


      c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1131): error C2011: ''_D3DBASISTYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1410): error C2011: ''_D3DBACKBUFFER_TYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(213): error C2011: ''_D3DBLEND'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(230): error C2011: ''_D3DBLENDOP'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1542): error C2011: ''_D3DBOX'' : ''struct'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3d9types.h(1630) : see declaration of ''_D3DBOX''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(255): error C2011: ''_D3DCMPFUNC'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1456): error C2011: ''_D3DCUBEMAP_FACES'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(248): error C2011: ''_D3DCULL'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1633): error C2011: ''_D3DDEBUGMONITORTOKENS'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1336): error C2011: ''_D3DDEVICE_CREATION_PARAMETERS'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1669): error C2011: ''_D3DDEVINFO_D3DVERTEXSTATS'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1664): error C2011: ''_D3DDEVINFO_RESOURCEMANAGER'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1202): error C2011: ''_D3DDEVTYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1327): error C2011: ''_D3DDISPLAYMODE'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(201): error C2011: ''_D3DFILLMODE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(279): error C2011: ''_D3DFOGMODE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1269): error C2011: ''_D3DFORMAT'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1402): error C2011: ''_D3DGAMMARAMP'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1497): error C2011: ''_D3DINDEXBUFFER_DESC'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(160): error C2011: ''_D3DLIGHTTYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1552): error C2011: ''_D3DLOCKED_BOX'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1535): error C2011: ''_D3DLOCKED_RECT'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(408): error C2011: ''_D3DMATERIALCOLORSOURCE'' : ''enum'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3d9types.h(439) : see declaration of ''_D3DMATERIALCOLORSOURCE''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1212): error C2011: ''_D3DMULTISAMPLE_TYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1148): error C2011: ''_D3DPATCHEDGESTYLE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1356): error C2011: ''_D3DPOOL'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1373): error C2011: ''_D3DPRESENT_PARAMETERS_'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(295): error C2011: ''_D3DPRIMITIVETYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1560): error C2011: ''_D3DRANGE'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1614): error C2011: ''_D3DRASTER_STATUS'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1567): error C2011: ''_D3DRECTPATCH_INFO'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(325): error C2011: ''_D3DRENDERSTATETYPE'' : ''enum'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3d9types.h(325) : see declaration of ''_D3DRENDERSTATETYPE''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1645): error C2011: ''_D3DRESOURCESTATS'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1420): error C2011: ''_D3DRESOURCETYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(194): error C2011: ''_D3DSHADEMODE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(879): error C2011: ''_D3DSHADER_INSTRUCTION_OPCODE_TYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(979): error C2011: ''_D3DSHADER_PARAM_REGISTER_TYPE'' : ''enum'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3d9types.h(979) : see declaration of ''_D3DSHADER_PARAM_REGISTER_TYPE''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1091): error C2011: ''_D3DSHADER_PARAM_SRCMOD_TYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1155): error C2011: ''_D3DSTATEBLOCKTYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(267): error C2011: ''_D3DSTENCILOP'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1508): error C2011: ''_D3DSURFACE_DESC'' : ''struct'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3d9types.h(1597) : see declaration of ''_D3DSURFACE_DESC''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1346): error C2011: ''_D3DSWAPEFFECT'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(239): error C2011: ''_D3DTEXTUREADDRESS'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(560): error C2011: ''_D3DTEXTUREFILTERTYPE'' : ''enum'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3d9types.h(621) : see declaration of ''_D3DTEXTUREFILTERTYPE''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(484): error C2011: ''_D3DTEXTUREOP'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(439): error C2011: ''_D3DTEXTURESTAGESTATETYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1175): error C2011: ''_D3DTEXTURETRANSFORMFLAGS'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(305): error C2011: ''_D3DTRANSFORMSTATETYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1578): error C2011: ''_D3DTRIPATCH_INFO'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1165): error C2011: ''_D3DVERTEXBLENDFLAGS'' : ''enum'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3d9types.h(1205) : see declaration of ''_D3DVERTEXBLENDFLAGS''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1484): error C2011: ''_D3DVERTEXBUFFER_DESC'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1521): error C2011: ''_D3DVOLUME_DESC'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(1007): error C2011: ''_D3DVS_ADDRESSMODE_TYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(994): error C2011: ''_D3DVS_RASTOUT_OFFSETS'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(241): error C2011: ''_D3DXMATRIXA16'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(287): error C2011: ''_D3DZBUFFERTYPE'' : ''enum'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(405): error C2011: ''D3DXCOLOR'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(174): error C2011: ''D3DXMATRIX'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(374): error C2011: ''D3DXPLANE'' : ''struct'' type redefinition        c:\SDK''s\DirectX 9 SDK\Include\d3dx9math.h(470) : see declaration of ''D3DXPLANE''c:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(329): error C2011: ''D3DXQUATERNION'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(43): error C2011: ''D3DXVECTOR2'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(86): error C2011: ''D3DXVECTOR3'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(130): error C2011: ''D3DXVECTOR4'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(1114): error C2011: ''ID3DXMatrixStack'' : ''struct'' type redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(968): error C2059: syntax error : ''}''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(965): error C2059: syntax error : ''constant''c:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(146): error C2084: function ''BOOL D3DXVECTOR2::operator !=(const D3DXVECTOR2 &) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(140): error C2084: function ''BOOL D3DXVECTOR2::operator ==(const D3DXVECTOR2 &) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(69): error C2084: function ''D3DXVECTOR2 &D3DXVECTOR2::operator -=(const D3DXVECTOR2 &)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(77): error C2084: function ''D3DXVECTOR2 &D3DXVECTOR2::operator *=(FLOAT)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(85): error C2084: function ''D3DXVECTOR2 &D3DXVECTOR2::operator /=(FLOAT)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(61): error C2084: function ''D3DXVECTOR2 &D3DXVECTOR2::operator +=(const D3DXVECTOR2 &)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(114): error C2084: function ''D3DXVECTOR2 D3DXVECTOR2::operator -(const D3DXVECTOR2 &) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(101): error C2084: function ''D3DXVECTOR2 D3DXVECTOR2::operator -(void) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(120): error C2084: function ''D3DXVECTOR2 D3DXVECTOR2::operator *(FLOAT) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(126): error C2084: function ''D3DXVECTOR2 D3DXVECTOR2::operator /(FLOAT) const'' already has a body        c:\SDK''s\DirectX 9 SDK\Include\d3dx9math.h(114) : see previous definition of ''/''c:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(108): error C2084: function ''D3DXVECTOR2 D3DXVECTOR2::operator +(const D3DXVECTOR2 &) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(95): error C2084: function ''D3DXVECTOR2 D3DXVECTOR2::operator +(void) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(134): error C2084: function ''D3DXVECTOR2 operator *(FLOAT,const D3DXVECTOR2 &)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(28): error C2084: function ''D3DXVECTOR2::D3DXVECTOR2(const FLOAT *)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(40): error C2084: function ''D3DXVECTOR2::D3DXVECTOR2(FLOAT,FLOAT)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(54): error C2084: function ''D3DXVECTOR2::operator`const FLOAT *''(void) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(48): error C2084: function ''D3DXVECTOR2::operator`FLOAT *''(void)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(212): error C2084: function ''D3DXVECTOR3 &D3DXVECTOR3::operator -=(const D3DXVECTOR3 &)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(221): error C2084: function ''D3DXVECTOR3 &D3DXVECTOR3::operator *=(FLOAT)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(203): error C2084: function ''D3DXVECTOR3 &D3DXVECTOR3::operator +=(const D3DXVECTOR3 &)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(171): error C2084: function ''D3DXVECTOR3::D3DXVECTOR3(const D3DVECTOR &)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(158): error C2084: function ''D3DXVECTOR3::D3DXVECTOR3(const FLOAT *)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(179): error C2084: function ''D3DXVECTOR3::D3DXVECTOR3(FLOAT,FLOAT,FLOAT)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(195): error C2084: function ''D3DXVECTOR3::operator`const FLOAT *''(void) const'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(189): error C2084: function ''D3DXVECTOR3::operator`FLOAT *''(void)'' already has a bodyc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(968): error C2143: syntax error : missing '';'' before ''}''c:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(965): error C2143: syntax error : missing ''}'' before ''(''c:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(102): error C2264: ''D3DXVECTOR2::D3DXVECTOR2'' : error in function definition or declaration; function not calledc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(109): error C2264: ''D3DXVECTOR2::D3DXVECTOR2'' : error in function definition or declaration; function not calledc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(115): error C2264: ''D3DXVECTOR2::D3DXVECTOR2'' : error in function definition or declaration; function not calledc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(121): error C2264: ''D3DXVECTOR2::D3DXVECTOR2'' : error in function definition or declaration; function not calledc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(128): error C2264: ''D3DXVECTOR2::D3DXVECTOR2'' : error in function definition or declaration; function not calledc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(135): error C2264: ''D3DXVECTOR2::D3DXVECTOR2'' : error in function definition or declaration; function not calledc:\Documents and Settings\Kyle\My Documents\My Projects\The Sirius Engine\DX9 30-12-02\source\Common\dxutil.cpp(675): error C2371: ''DXUtil_ConvertStringToGUID'' : redefinition; different basic typesc:\Documents and Settings\Kyle\My Documents\My Projects\The Sirius Engine\DX9 30-12-02\source\Common\dxutil.cpp(675): error C2556: ''BOOL DXUtil_ConvertStringToGUID(const TCHAR *,GUID *)'' : overloaded function differs only by return type from ''HRESULT DXUtil_ConvertStringToGUID(const TCHAR *,GUID *)''c:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(628): error C2733: second C linkage of overloaded function ''D3DXVec3Project'' not allowedc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.h(633): error C2733: second C linkage of overloaded function ''D3DXVec3Unproject'' not allowedc:\SDK''s\DirectX 9 SDK\Include\d3dx8math.inl(221): fatal error C1003: error count exceeds 100; stopping compilationc:\SDK''s\DirectX 9 SDK\Include\d3d8.h(27): warning C4005: ''D3D_SDK_VERSION'' : macro redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(579): warning C4005: ''D3DFVF_POSITION_MASK'' : macro redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(607): warning C4005: ''D3DFVF_RESERVED2'' : macro redefinitionc:\SDK''s\DirectX 9 SDK\Include\d3d8types.h(950): warning C4005: ''D3DSP_REGNUM_MASK'' : macro redefinitionC:\SDK''s\DirectX 9 SDK\Include\d3dx8.h(33): warning C4005: ''D3DX_DEFAULT'' : macro redefinition  


    Thanks again!
    Advertisement
    Do you have one header file and is that file included in multiple source files? If so, that might be the case and you''ll have to use #ifndef or #pragma once.

    Hibiki
    Wheres the any key?
    www.geocities.com/dragongames123/home.html

    INSERT MY OVER-SIZED EXTRAVOGENT PIC HERE:
    HibikiWheres the any key?www.geocities.com/dragongames123/home.htmlINSERT MY OVER-SIZED EXTRAVOGENT PIC HERE:
    I use pragma once and precompiled headers. I've only put the d3d header files in my precompiled header.

    Edit: Btw, this is what my precompiled header looks like

        #pragma once#define WIN32_LEAN_AND_MEAN#include <windows.h>#include <windowsx.h>#include <basetsd.h>#pragma warning (disable: 4201)#include <mmsystem.h>#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string>#include "..\stlport\vector"using namespace std;#include <atlbase.h>#include <d3d9.h>#include <d3dx9.h>#include "Common/dxutil.h"#pragma comment(lib, "d3d9.lib")#pragma comment(lib, "d3dx9.lib")#pragma comment(lib, "dxguid.lib")#pragma comment(lib, "d3dxof.lib")#pragma comment(lib, "dinput9.lib")#pragma comment(lib, "dxguid.lib")#pragma comment(lib, "winmm.lib")#define DIRECTINPUT_VERSION 0x0900#include <dinput.h>#pragma warning (disable: 4201 4100 4189)    



    [edited by - Fuzztrek on December 30, 2002 7:37:32 PM]
    Nevermind. I accidentally included some common files in my project (that were dx8 common, not dx9) and thats what was causing the screw up. Thanks anyways!
    Not to sound dumb or anything, but DX9 is out?!


    tcache
    Contact Me
    -----------
    Games don''t affect kids. If Pac-man had affected us, we''d all be sitting in darkened rooms munching pills and
    listening to repetitive electronic music. -- Kristian Wilson(Nintendo Inc., 1989)
    tcacheContact Me-----------AH! MY BRAIN IS GOING TO SELF-DETONATE! -- Yours Truly (Jan, 2003)
    Advertisement
    Yup.

    Hibiki
    Wheres the any key?
    www.geocities.com/dragongames123/home.html

    INSERT MY OVER-SIZED EXTRAVOGENT PIC HERE:
    HibikiWheres the any key?www.geocities.com/dragongames123/home.htmlINSERT MY OVER-SIZED EXTRAVOGENT PIC HERE:

    This topic is closed to new replies.

    Advertisement