![]() |
| | #1 |
| Registered User Join Date: Oct 2003
Posts: 4
| DirectX SDK Error, annoyance at the line #include "dxfile.h" // defines LPDIRECTXFILEDATA and the debugger says: Compiler: Default compiler Executing g++.exe... g++.exe "C:\Documents and Settings\Haxxor\Desktop\D3Dintro\D3DIntro.cpp" -o "C:\Documents and Settings\Haxxor\Desktop\D3Dintro\D3DIntro.exe" -g3 -I"D:\Dev-Cpp\include\c++" -I"D:\Dev-Cpp\include\c++\mingw32" -I"D:\Dev-Cpp\include\c++\backward" -I"D:\Dev-Cpp\include" -I"C:\DX90SDK\Include" -I"C:\DX90SDK\Samples\C++\Common" -I"C:\DX90SDK\Include\DShowIDL" -I"D:\Dev-Cpp\include" -L"D:\Dev-Cpp\lib" -L"C:\DX90SDK\Lib" In file included from C:/DX90SDK/Include/d3dx9mesh.h:15, from C:/DX90SDK/Include/d3dx9.h:47, from C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:32: C:/DX90SDK/Include/dxfile.h:240: stray '\32' in program In file included from C:/DX90SDK/Include/d3dx9mesh.h:15, from C:/DX90SDK/Include/d3dx9.h:47, from C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:32: C:/DX90SDK/Include/dxfile.h:240:2: warning: no newline at end of file C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp: In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)': C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:141: warning: passing NULL used for non-pointer argument passing 1 of `HWND__* CreateWindowExA(long unsigned int, const CHAR*, const CHAR*, long unsigned int, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)' C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:141: warning: argument to non-pointer type `long unsigned int' from NULL C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:163: warning: passing NULL used for non-pointer argument passing 3 of `BOOL PeekMessageA(tagMSG*, HWND__*, unsigned int, unsigned int, unsigned int)' C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:163: warning: argument to non-pointer type `unsigned int' from NULL C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:163: warning: passing NULL used for non-pointer argument passing 4 of `BOOL PeekMessageA(tagMSG*, HWND__*, unsigned int, unsigned int, unsigned int)' C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:163: warning: argument to non-pointer type `unsigned int' from NULL C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:185: invalid conversion from `void*' to `HINSTANCE__*' C:/Documents and Settings/Haxxor/Desktop/D3Dintro/D3DIntro.cpp:371:35: warning: no newline at end of file Execution terminated Do you have any idea? |
| Hidden-Shadow is offline | |
| | #2 |
| erstwhile Join Date: Jan 2002
Posts: 2,223
| Generally if you get a warning like "invalid conversion from 'x' to 'y' " then you are probably compiling something as c++ that might otherwise compile ok as C; in short, cast to the required type which is being complained about (eg. void* to HINSTANCE requires an explicit type cast to HINSTANCE). The newline at end of file warning is common with gcc (g++); apparently it's now standard to have a newline at the end of each file so get into the habit of adding one to eliminate that annoying warning. NULL is good for pointers only, not numbers, hence " NULL used for non-pointer argument". Zero works for numbers and pointers so, to avoid this hassle, just use zero for both ie zero for NULL pointer and as the numeral itself. If you prefer to continue to use NULL then remember to use it only with pointers. "stray '\32' in program" - don't have a clue; that's a new one on me. However the compiler, as with all such errors\warnings, usually explicitly tells you where the problem occurs. So open up 'dxfile.h' and take a close look at (and possibly around) line 240 to see what the problem is. Hope that helps some.
__________________ CProgramming FAQ Caution: this person may be a carrier of the misinformation virus. Last edited by Ken Fitlike; 10-11-2003 at 09:09 AM. |
| Ken Fitlike is offline | |
| | #3 |
| Super Moderator Join Date: Aug 2001
Posts: 7,812
| Sounds like the compiler does not recognize most of the declarations in the header file. This will produce oodles and oodle of warnings. Check to make sure that the header file is compatible with your compiler.
__________________ If you aim at everything you will hit something but you won't know what it is. |
| Bubba is offline | |
| | #4 |
| Registered User Join Date: Oct 2003
Posts: 4
| DirectX SDK Error, annoyance I switch to MSV C++ 6.0 and tried #include <ddraw.h> and this showed up: Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/DDrawtut.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. DDrawtut.exe - 2 error(s), 0 warning(s) help this is really annoying me, why isn't the SDK working correctly! |
| Hidden-Shadow is offline | |
| | #5 |
| Pursuing knowledge Join Date: Jun 2002
Posts: 1,916
| Are you linking the correct libraries? Did you create a windows project, or a console app? (should be former)
__________________ Away. |
| confuted is offline | |
| | #6 |
| Registered User Join Date: Oct 2003
Posts: 4
| DirectX SDK Error, annoyance Win32 project i'm pretty sure. |
| Hidden-Shadow is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DirectSound header issues | dxfoo | C++ Programming | 0 | 03-19-2006 07:16 PM |
| Question.. | pode | Windows Programming | 12 | 12-19-2004 07:05 PM |
| Directx SDK Documentation | Zoalord | Game Programming | 4 | 05-08-2003 06:07 AM |
| DirectX SDK and ActiveX SDK | moemen ahmed | A Brief History of Cprogramming.com | 1 | 06-30-2002 04:16 AM |
| DirectX SDK | c++_n00b | Game Programming | 6 | 04-04-2002 12:39 PM |