|
 | 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. | |
|
|
 | | |  |
|
|
|
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
|
|