PDA

View Full Version : A few compiling errors.



Slay
05-25-2008, 06:42 AM
Can you help me with theese?

d:\documents and settings\daniel\pulpit\d3d_starterkit_v3_1_.0b\d3d _starterkit_v3.0b\d3d8\d3d8dev.cpp(142) : error C2065: 'phandle' : undeclared identifier
d:\documents and settings\daniel\pulpit\d3d_starterkit_v3_1_.0b\d3d _starterkit_v3.0b\d3d8\d3d8dev.cpp(371) : error C2664: 'DrawTextA' : cannot convert parameter 3 from 'struct IDirect3DTexture8 *' to 'unsigned long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
d:\documents and settings\daniel\pulpit\d3d_starterkit_v3_1_.0b\d3d _starterkit_v3.0b\d3d8\d3d8dev.cpp(373) : error C2664: 'DrawTextA' : cannot convert parameter 3 from 'struct IDirect3DTexture8 *' to 'unsigned long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
d:\documents and settings\daniel\pulpit\d3d_starterkit_v3_1_.0b\d3d _starterkit_v3.0b\d3d8\d3d8dev.cpp(376) : error C2664: 'DrawTextA' : cannot convert parameter 3 from 'struct IDirect3DTexture8 *' to 'unsigned long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
d:\documents and settings\daniel\pulpit\d3d_starterkit_v3_1_.0b\d3d _starterkit_v3.0b\d3d8\d3d8dev.cpp(378) : error C2664: 'DrawTextA' : cannot convert parameter 3 from 'struct IDirect3DTexture8 *' to 'unsigned long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.

1st:" CloseHandle(phandle);"
2nd:" m_pFont_INFO->DrawText(15.0f, 220.0f, texWhite, chamsstring);"
3rd:" m_pFont_INFO->DrawText(15.0f,220.0f, texRed, chamsstring);"
4th:" m_pFont_INFO->DrawText(15.0f, 230.0f,texWhite, raystring);"
5th:" m_pFont_INFO->DrawText(15.0f, 230.0f,texRed, raystring);"

Before theese errors I fixed ~50 others by searching up this forum, but I still can't fix theese ones :(

masterboy
05-25-2008, 07:44 AM
First error put this on top on d38dev.cpp
HANDLE phandle;


about the other errors,i think u missing something but I'm not sure what..

Slay
05-25-2008, 11:20 AM
Thanks for help, already figured out the rest by changing texRed to txtRed, texWhite to txtWhite and using this topic: http://www.dxth4x.com/forums/showthread.php?t=5106&highlight=txtWhite.

EDIT:
Lol! Now I get 32 errors + 3 warnings:

Compiling...
d3d8dev.cpp
d:visual basic 6vc98includestreambuf(181) : warning C4100: '_Loc' : unreferenced formal parameter
d:visual basic 6vc98includestreambuf(182) : while compiling class-template member function 'void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::imbue(const class std::locale &)'
d:visual basic 6vc98includestreambuf(181) : warning C4100: '_Loc' : unreferenced formal parameter
d:visual basic 6vc98includestreambuf(182) : while compiling class-template member function 'void __thiscall std::basic_streambuf<unsigned short,struct std::char_traits<unsigned short> >::imbue(const class std::locale &)'
d:visual basic 6vc98includexstring(600) : warning C4245: 'initializing' : conversion from 'const int' to 'const unsigned int', signed/unsigned mismatch
d:visual basic 6vc98includexmemory(59) : while compiling class-template static data member 'const unsigned int std::basic_string<char,std::char_traits<char>,std::allocator<char> >::npos'
d3d8dev.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFont::RestoreDeviceObjects(void)" (?RestoreDeviceObjects@CD3DFont@@QAEJXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice8 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevi ce8@@@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: __thiscall CD3DFont::CD3DFont(char *,unsigned long,unsigned long)" (??0CD3DFont@@QAE@PADKK@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFont::DeleteDeviceObjects(void)" (?DeleteDeviceObjects@CD3DFont@@QAEJXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFont::InvalidateDeviceObjects(void)" (?InvalidateDeviceObjects@CD3DFont@@QAEJXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol __imp__GetAsyncKeyState@4
d3d8dev.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFont::DrawTextA(float,float,unsigned long,char *,unsigned long)" (?DrawTextA@CD3DFont@@QAEJMMKPADK@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::AddDirtyRect(struct tagRECT const *)" (?AddDirtyRect@hkIDirect3DTexture8@@UAGJPBUtagRECT @@@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::UnlockRect(unsigned int)" (?UnlockRect@hkIDirect3DTexture8@@UAGJI@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::LockRect(unsigned int,struct _D3DLOCKED_RECT *,struct tagRECT const *,unsigned long)" (?LockRect@hkIDirect3DTexture8@@UAGJIPAU_D3DLOCKED _REC
T@@PBUtagRECT@@K@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::GetSurfaceLevel(unsigned int,struct IDirect3DSurface8 * *)" (?GetSurfaceLevel@hkIDirect3DTexture8@@UAGJIPAPAUI Direct3DSurface8@@@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::GetLevelDesc(unsigned int,struct _D3DSURFACE_DESC *)" (?GetLevelDesc@hkIDirect3DTexture8@@UAGJIPAU_D3DSU RFACE_DESC@@@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall hkIDirect3DTexture8::GetLevelCount(void)" (?GetLevelCount@hkIDirect3DTexture8@@UAGKXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall hkIDirect3DTexture8::GetLOD(void)" (?GetLOD@hkIDirect3DTexture8@@UAGKXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall hkIDirect3DTexture8::SetLOD(unsigned long)" (?SetLOD@hkIDirect3DTexture8@@UAGKK@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual enum _D3DRESOURCETYPE __stdcall hkIDirect3DTexture8::GetType(void)" (?GetType@hkIDirect3DTexture8@@UAG?AW4_D3DRESOURCE TYPE@@XZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual void __stdcall hkIDirect3DTexture8::PreLoad(void)" (?PreLoad@hkIDirect3DTexture8@@UAGXXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall hkIDirect3DTexture8::GetPriority(void)" (?GetPriority@hkIDirect3DTexture8@@UAGKXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall hkIDirect3DTexture8::SetPriority(unsigned long)" (?SetPriority@hkIDirect3DTexture8@@UAGKK@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::FreePrivateData(struct _GUID const &)" (?FreePrivateData@hkIDirect3DTexture8@@UAGJABU_GUI D@@@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::GetPrivateData(struct _GUID const &,void *,unsigned long *)" (?GetPrivateData@hkIDirect3DTexture8@@UAGJABU_GUID @@PAXPAK@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::SetPrivateData(struct _GUID const &,void const *,unsigned long,unsigned long)" (?SetPrivateData@hkIDirect3DTexture8@@UAGJABU_GUID @@PBXKK@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::GetDevice(struct IDirect3DDevice8 * *)" (?GetDevice@hkIDirect3DTexture8@@UAGJPAPAUIDirect3 DDevice8@@@Z)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall hkIDirect3DTexture8::Release(void)" (?Release@hkIDirect3DTexture8@@UAGKXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __stdcall hkIDirect3DTexture8::AddRef(void)" (?AddRef@hkIDirect3DTexture8@@UAGKXZ)
d3d8dev.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall hkIDirect3DTexture8::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@hkIDirect3DTexture8@@UAGJABU_GUID @@PAPAX@Z)
d3dx8.lib(cd3dxresource.obj) : error LNK2001: unresolved external symbol __imp__DeleteObject@4
d3dx8.lib(cpudetect.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4
d3dx8.lib(cpudetect.obj) : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24
d3dx8.lib(cpudetect.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyA@12
LIBCMTD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
d3d8dev.exe : fatal error LNK1120: 31 unresolved externals
Error executing cl.exe.
Help? :( I can't click on most of them and I guess I'm just lack of some library or header file :/

Anybody? I got them after putting " return m_pD3Ddev->EndScene();" at the end of endscene... before putting I got only 1 error, that wanted me to put it there.

Slay
05-26-2008, 07:39 AM
Finally I got no errors! How to fight with theese errors? Wait 2 days with thinking very bad about the errors and it will be gone XD

ganglyman21
05-26-2008, 08:28 AM
Hehe congrats. Look forward to seeing some of ya screenies at some point?

Slay
05-26-2008, 05:33 PM
Sure, when I finish it! :) First I need to detour becouse invalid program/driver kicks are annoying...

masterboy
05-27-2008, 04:12 AM
Detour is a hard thing to do...well patching strings...U should start making basic hacks first like stamina,no recoil,no spread...

Slay
05-27-2008, 05:32 AM
lol I already made them a long time ago... and btw I'm using d3d basically only to detour without problems and becouse it's trendy ;) my normal hack in C++ looks like that: http://img3.imagebanana.com/img/nr24cgzv/hack.PNG

Can somebody help me a bit with detouring? Basically I've got the code but I'm not sure if I do it right way. I'm editing this code:(I hope it wouldnt count as advertising, if it would then delete it please)http://www.wildmanstudios.com/wms-forums/showthread.php?t=600

masterboy
05-27-2008, 05:38 AM
I'm not sure if that will work because its posted in july 2007 so it might be outdated and the check offset is wrong..

Slay
05-27-2008, 06:15 AM
of course offset is wrong, and I did say that I edited the code a bit, cuz it was a logger of pb actions and I use it to check actual action of PB, if it isn't normal then hacksoff etc >.>
btw "detours.lib(disasm.obj) : fatal error LNK1103: debugging information corrupt; recompile module" o_0

masterboy
05-27-2008, 11:36 AM
Be sure to see if u got detours.lib on your project folder...

Slay
05-27-2008, 11:54 AM
its not that easy to fix :(

ODST_Tw1nZ
06-20-2009, 09:09 AM
can anybody help me wit this error?


error C2664: 'CD3DFont::DrawTextA' : cannot convert parameter 3 from 'LPDIRECT3DTEXTURE9' to 'DWORD'
1> There is no context in which this conversion is possible

Vescovo
06-20-2009, 10:50 AM
can anybody help me wit this error?


error C2664: 'CD3DFont::DrawTextA' : cannot convert parameter 3 from 'LPDIRECT3DTEXTURE9' to 'DWORD'
1> There is no context in which this conversion is possible

Go pickup a c++ book
and don't bounce another thread
it was really old.