Forum
Contact





DirectX using C#
DirectX using C++
DirectX using Visual Basic



Latest Forum posts

 Tutorial 3 for Windows Phone 7
  Posted by: Anonymous
  When: 20/05/2013 at 02:30:13

 No download link for 2d series: shooter
  Posted by: zaboleq
  When: 07/05/2013 at 15:46:28

 Collision Class?
  Posted by: Anonymous
  When: 05/05/2013 at 19:03:59

 stack overflow
  Posted by: cityguy
  When: 07/04/2013 at 01:58:38

 Meshes looks strange.
  Posted by: ab_saratov
  When: 01/04/2013 at 04:31:08

 Lamppost Not loaded
  Posted by: Anonymous
  When: 22/03/2013 at 06:43:52

 Collision Class?
  Posted by: Da_Boom
  When: 21/03/2013 at 01:23:09

 Math boggles me
  Posted by: cityguy
  When: 17/03/2013 at 03:44:48

 Collision Class?
  Posted by: Da_Boom
  When: 16/03/2013 at 03:44:42

 Tree update
  Posted by: Anonymous
  When: 15/03/2013 at 21:11:22

 XNA 4.0
  Posted by: Anonymous
  When: 15/03/2013 at 19:43:57

 Error when I try to run.
  Posted by: Anonymous
  When: 15/03/2013 at 19:21:06

 Error With the Effect File
  Posted by: Anonymous
  When: 15/03/2013 at 18:21:01

 Can only get shadowmap
  Posted by: Anonymous
  When: 15/03/2013 at 15:48:52

 Vertex and Pixel Shader Versions?
  Posted by: Anonymous
  When: 15/03/2013 at 15:07:16

 Unsupported properties
  Posted by: Anonymous
  When: 15/03/2013 at 14:23:00

 Problem Loading Skybox
  Posted by: Rana
  When: 15/03/2013 at 10:34:45

 Black Screen Of Death - Help!
  Posted by: Anonymous
  When: 15/03/2013 at 03:43:43

 2.0 anyone?
  Posted by: Anonymous
  When: 15/03/2013 at 02:19:48

 Defitinition of tha rotation axis
  Posted by: Anonymous
  When: 15/03/2013 at 00:55:14




Topic: d3dx9math.inl



  
Goto parent category
  
Create a new user account


   d3dx9math.inl
 Poster : zorexx
 Posts: 4
 Country :
 City:

  
Posted by zorexx on 26/11/2007 at 04:02:03
Switching to target: default
Compiling: main.cpp
In file included from C:/dxsdk/Include/d3dx9math.h:1787,
                 from C:/dxsdk/Include/d3dx9.h:47,
                 from main.cpp:3:
C:/dxsdk/Include/d3dx9math.inl: In static member function `static void* _D3DXMATRIXA16::operator new(size_t)':
C:/dxsdk/Include/d3dx9math.inl:993: warning: `operator new' must not return NULL unless it is declared `throw()' (or -fcheck-new is in effect)
C:/dxsdk/Include/d3dx9math.inl: In static member function `static void* _D3DXMATRIXA16::operator new [](size_t)':
C:/dxsdk/Include/d3dx9math.inl:1008: warning: `operator new' must not return NULL unless it is declared `throw()' (or -fcheck-new is in effect)
Linking executable: D:\LKL\LKL's Documents 4\c++\DirectX\learnt\Linking to the device\linkDevice.exe
.objs\main.o:main.cpp:(.text+0x152): undefined reference to `Direct3DCreate9@4'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)

^compile log^

i get this warning msg when compiling: 'operator new' must not return NULL unless it is declared 'throw()' (or -fcheck-new is in effect)

i'm using DirectX SDK November 2007 release
 Poster : Tophurious
 Posts: 43
 Country : US
 City: Golden

  
Posted by Tophurious on 26/11/2007 at 08:48:12
Are you doing something like this?


D3DXMatrix myMatrix = null;


do you have classes where your constructor is formatted like this?


MyClass::MyClass(args)
{
  ...

  return something;
}


without seeing where in your Main.Cpp the error is occuring at we can't really tell you the problem only guess...
 Poster : zorexx
 Posts: 4
 Country :
 City:

  
Posted by zorexx on 26/11/2007 at 20:44:38
i dont think the error is in my code though, coz i've even tried copy and pasting the whole code at the bottom of the tutorial page
anyway this is my code:
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>

int int_AppRunning = 1;

MSG msg_Message;

LRESULT CALLBACK OurWindowProcedure(HWND han_Wind, UINT uint_Message, WPARAM parameter1, LPARAM parameter2)
{
    switch(uint_Message)
    {
        case WM_KEYDOWN:
        {
            int_AppRunning = 0;
            break;
        }
        break;
    }

    return DefWindowProc(han_Wind, uint_Message, parameter1, parameter2);
}

HWND NewWindow(LPCTSTR str_Title, int int_XPos, int int_YPos, int int_Width, int int_Height)
{
    WNDCLASSEX wnd_Structure;

    wnd_Structure.cbSize = sizeof(WNDCLASSEX);
    wnd_Structure.style = CS_HREDRAW | CS_VREDRAW;
    wnd_Structure.lpfnWndProc = OurWindowProcedure;
    wnd_Structure.cbClsExtra = 0;
    wnd_Structure.cbWndExtra = 0;
    wnd_Structure.hInstance = GetModuleHandle(NULL);
    wnd_Structure.hIcon = NULL;
    wnd_Structure.hCursor = NULL;
    wnd_Structure.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
    wnd_Structure.lpszMenuName = NULL;
    wnd_Structure.lpszClassName = "WindowClassName";
    wnd_Structure.hIconSm = LoadIcon(NULL,IDI_APPLICATION);

    RegisterClassEx(&wnd_Structure);

    return CreateWindowEx(WS_EX_CONTROLPARENT, "WindowClassName", str_Title, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE, int_XPos, int_YPos, int_Width, int_Height, NULL, NULL, GetModuleHandle(NULL), NULL);
}

LPDIRECT3DDEVICE9 InitializeDevice(HWND han_WindowToBindTo)
{
    LPDIRECT3D9 p_dx_Object;

    LPDIRECT3DDEVICE9 p_dx_Device;

    p_dx_Object = Direct3DCreate9(D3D_SDK_VERSION);
    if(p_dx_Object == NULL)
    {
        MessageBox(han_WindowToBindTo, "DirectX Runtime library not installed!", "InitializeDevice()", MB_OK);
    }

    D3DPRESENT_PARAMETERS dx_PresParams;

    ZeroMemory(&dx_PresParams, sizeof(dx_PresParams));
    dx_PresParams.Windowed = TRUE;
    dx_PresParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
    dx_PresParams.BackBufferFormat = D3DFMT_UNKNOWN;

    if(FAILED(p_dx_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, han_WindowToBindTo, D3DCREATE_HARDWARE_VERTEXPROCESSING, &dx_PresParams, &p_dx_Device)))
    {
        if(FAILED(p_dx_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, han_WindowToBindTo, D3DCREATE_HARDWARE_VERTEXPROCESSING, &dx_PresParams, &p_dx_Device)))
        {
            MessageBox(han_WindowToBindTo, "Failed to create even the reference device!", "InitializeDevice()", MB_OK);
        }
    }

    return p_dx_Device;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreviousInstance, LPSTR lpcmdline, int nCmdShow)
{
    HWND han_Window = NewWindow("DirectX C++ Tutorial", 100, 100, 500, 500);

    LPDIRECT3DDEVICE9 p_Device = InitializeDevice(han_Window);

    while(int_AppRunning)
    {
        if(PeekMessage(&msg_Message, han_Window, 0, 0, PM_REMOVE))
        {
            if(!IsDialogMessage(han_Window, &msg_Message))
            {
                TranslateMessage(&msg_Message);
                DispatchMessage(&msg_Message);
            }
        }
    }

    p_Device->Release();

    DestroyWindow(han_Window);
    return 0;
}


and also the error(warning) says that the error is in d3dx9math.inl line 993, and 1008, means it isnt in my file rite?
 Poster : Tophurious
 Posts: 43
 Country : US
 City: Golden

  
Posted by Tophurious on 26/11/2007 at 23:16:28
Yeah you're right, wasn't thinking...

Are you including the dlls you need? Do you have your project searching the right directories for these DLLs? You might try to reinstall DX9 with the latest release...
 Poster : zorexx
 Posts: 4
 Country :
 City:

  
Posted by zorexx on 27/11/2007 at 05:51:19
wat dll? the tutorial didnt mentioned about including dlls didnt it?

and the directX sdk i'm using is the newest
 Poster : Tophurious
 Posts: 43
 Country : US
 City: Golden

  
Posted by Tophurious on 27/11/2007 at 07:52:36
These are for VS2005

You're using C++, so you need to link to any libraries outside of your project (just like in any other language). First you have to tell the compiler where to look for the new DLLs which should be done for you with the newest version of DX9. You can check anyway, its under the project->properties->reference i believe. Anyway. Now, go to project->properties->Configuation Properties->Linker->Input and add to the additional dependencies box:
d3dxof.lib
dxguid.lib
d3dx9d.lib
d3d9.lib
d3dx9.lib
dinput8.lib
winmm.lib
dxerr.lib

you should be good.
 Poster : zorexx
 Posts: 4
 Country :
 City:

  
Posted by zorexx on 27/11/2007 at 09:17:24
hey it really worked, i just have to add the library of each header file i used, for example if i use d3d9.h and d3dx9.h, i'll just have to add d3d9.lib and d3dx9.lib for it to work.
anyway theres an error if i add the file extension(.lib), so i added d3d9 instead of d3d9.lib, same goes to d3dx9.
thx very much now i can finally continue, lol
 Poster : Tophurious
 Posts: 43
 Country : US
 City: Golden

  
Posted by Tophurious on 27/11/2007 at 09:39:25
Glad to help
 Poster : Cinshe
 Posts: 1
 Country : United States
 City: Walla Walla

  
Posted by Cinshe on 19/08/2008 at 18:49:47
I had the same error, and this thread seemed to help.  After compiling however it gives me this:

E:\C++\Projects\DirectX Tutorial\Makefile.win [Build Error]  ["DirectX] Error 1

Additionally, running it in debug gives me the same errors as the original poster.  

I'm using DevC++, thanks for any help
 Poster : Anonymous
 Posts:
 Country :
 City:

  
Posted by Anonymous on 20/06/2012 at 19:23:00
I’m impressed, I have to say. Actually raelry do I encounter a blog that’s each educative and entertaining, and let me let you know, you've gotten hit the nail on the head. Your idea is outstanding; the difficulty is one thing that not enough persons are speaking intelligently about. I'm very comfortable that I stumbled across this in my seek for something regarding this.

  
Post a new reply
 





Google
 
Web www.riemers.net
If you appreciate the amount of time I spend creating and updating
these pages, feel free to donate -- any amount is welcome !
- Website design & DirectX code : Riemer Grootjans -
©2006 Riemer Grootjans


News
Home
Forum
XNA 2.0 Recipes Book (8)
XNA 3.0 Recipes Book (8)
Downloads
Extra Reading (3)
Matrices: geometrical
Matrix Mathematics
Homogenous matrices
Community Projects (1)
Tutorials (160)
XNA 4.0 using C# (89)
DirectX using C# (54)
Series 1:Terrain (14)
Opening a window
Linking to the Device
Drawing a triangle
Camera
Rotation - Translation
Indices
Terrain creation
Terrain from file
DirectInput
Importing bmp files
Colored vertices
DirectX Light basics
Mesh creation
Mesh lighting
Series 2: Flightsim (19)
Series 3: HLSL (19)
Short Tuts (2)
Resizing problem
Checking Device caps
DirectX using C++ (15)
DirectX using VB (2)