Skip to main content
gamedev.net
🔒 Locked

Compile Error...

Started by Mark04 4 replies 600+ views
Original Post
Mark04
Mark04
Hi :) Need a bit of help on a DirectX Program in C++: I have compiled the CPP file and all compiles fine (0 errors, 0 warnings). But, when I compile the EXE I get the following 3 error messages: d3dapp.cpp c:\directx\coding\common code\d3dapp.cpp(1225) : error C2664: 'DialogBoxParamA' : cannot convert parameter 4 from 'long (struct HWND__ *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int ,unsigned int,long)' None of the functions with this name in scope match the target type d3dfile.cpp c:\directx\coding\common code\d3dfile.cpp(203) : error C2660: 'D3DXComputeNormals' : function does not take 1 parameters c:\directx\coding\common code\d3dfile.cpp(205) : error C2660: 'D3DXComputeNormals' : function does not take 1 parameters Error executing cl.exe. Any ideas on what might be causing the above errors and how I can resolve them?? Thanks!! Mark.
Ytinasni
Ytinasni
Quote:
Original post by Mark04
c:\directx\coding\common code\d3dapp.cpp(1225) : error C2664: 'DialogBoxParamA' : cannot convert parameter 4 from 'long (struct

You're missing the () on a function call, most likely.

Quote:

c:\directx\coding\common code\d3dfile.cpp(203) : error C2660: 'D3DXComputeNormals' : function does not take 1 parameters

It tells you exactly what the problem is.
Phillip Martin
Phillip Martin
For DialogBoxParamA, The error is saying that the function argument you are passing in isn't the same type as it is expecting. Looking at the error, the only difference is that the calling convention is different.

To fix it, just put a WINAPI before your return type of your function definition, and it should be all dandy.

For D3DXComputeNormals, my MSDN says that it expects two argments, LPD3DXBASEMESH and a CONST DWORD*, and the error is saying you're only giving it one. Look at the help for D3DXComputeNormals, and then look at your code, and see if you can add in the missing bits. You're haven't posted your code, so I can't say exactly what to add.

- Phil

Mark04
Mark04
Hi.

Thanks for the reply.

Am only a newbie to DX!!

Not sure what the 'Parameter' means that its talking about??

Mark.
Mark04
Mark04
Hi.

OK, Thanks I will try and figure it out!

Mark.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.