Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: The exact size of "string" problem Pin
JohnCz23-Nov-09 17:36
JohnCz23-Nov-09 17:36 
Questionrunning time of java pograms Pin
cool_joy222-Nov-09 16:14
cool_joy222-Nov-09 16:14 
AnswerRe: running time of java pograms Pin
Richard MacCutchan22-Nov-09 21:36
mveRichard MacCutchan22-Nov-09 21:36 
GeneralRe: running time of java pograms Pin
cool_joy225-Nov-09 22:34
cool_joy225-Nov-09 22:34 
GeneralRe: running time of java pograms Pin
Richard MacCutchan25-Nov-09 23:49
mveRichard MacCutchan25-Nov-09 23:49 
GeneralRe: running time of java pograms Pin
cool_joy228-Nov-09 1:52
cool_joy228-Nov-09 1:52 
QuestionITextServices::Release() doesn't effect.That causes memory leaking. Pin
hawkgao012922-Nov-09 15:14
hawkgao012922-Nov-09 15:14 
QuestionError during compilation that I dont understand. [Solved] Pin
stianhh22-Nov-09 0:59
stianhh22-Nov-09 0:59 
Hi.
First I would like to say that I am quite the beginner using C++. I have just started to learn DirectX and I have a problem compiling. Maybe this post should be put in the Graphics forum but I don’t know if it is really a Graphics problem.

I went through the tutorial called “Beginning Direct3D by Vahid Kazemi” found here codeproject.com[^] and it worked great. I am currenly reading a book called “Introduction to 3D game programming with DirectX 9.0 by Frank D. Luna”. In the beginning of this book there is a tutorial/sample project that basically is the same as the one by Vahid Kazemi only structured a bit differently. It has the basic framework that I am supposed to build the rest of the tutorials in the book on. Now I am having some problems getting the project form the book to compile.

Here is the compiler error:
-----
1>Linking...

1>Main.obj : error LNK2019: unresolved external symbol "bool __cdecl d3d::InitD3D(struct HINSTANCE__ *,int,int,bool,enum _D3DDEVTYPE,struct IDirect3DDevice9 * *)" (?InitD3D@d3d@@YA_NPAUHINSTANCE__@@HH_NW4_D3DDEVTYPE@@PAPAUIDirect3DDevice9@@@Z) referenced in function _WinMain@16

1>C:\Users\Stian H. Haug\Documents\Visual Studio 2008\Projects\Spill Programmering\Spillprogrammering - Sample One\Debug\Spillprogrammering - Sample One.exe : fatal error LNK1120: 1 unresolved externals

1>Build log was saved at "file://c:\Users\Stian H. Haug\Documents\Visual Studio 2008\Projects\Spill Programmering\Spillprogrammering - Sample One\Spillprogrammering - Sample One\Debug\BuildLog.htm"
1>Spillprogrammering - Sample One - 2 error(s), 0 warning(s)
-----
Judgeing by the error i thought it might be a linking error. However I managed to compile the tutorial by Vahid Kazemi and I have included all the same files, .lib and such that I included in that tutorial.
Here is my WinMain loop where I call the InitD3D() function.
int WINAPI WinMain(HINSTANCE hinstance,
				   HINSTANCE prevInstance,
				   PSTR cmdLine,
				   int showCmd)
{
	if(!d3d::InitD3D(hinstance, 800, 600, true, D3DDEVTYPE_HAL, &Device))
	{
		::MessageBox(0, "InitD3D() - FAILED", 0, 0);
		return 0;
	}
	if(!Setup())
	{
		::MessageBox(0, "Setup() - FAILED", 0, 0);
			return 0;
	}

	d3d::EnterMsgLoop( Display );

	Cleanup();

	Device->Release();

	return 0;
}

Here is the prototype in my header file:
bool InitD3D(
            HINSTANCE hInstance,
            int width, int height,
            bool windowed,
            D3DDEVTYPE deviceType,
            IDirect3DDevice9** device);

I belive the InitD3D()function is implemented in one of these files:
#include <d3d9.h>
#include <d3dx9.h>

I have included them both.

If anyone can help me with understanding this problem it would be great. If you want me to post the whole code i can.

Thanks!

modified on Sunday, November 22, 2009 3:38 PM

AnswerRe: Error during compilation that I dont understand. Pin
Richard MacCutchan22-Nov-09 1:11
mveRichard MacCutchan22-Nov-09 1:11 
GeneralRe: Error during compilation that I dont understand. Pin
stianhh22-Nov-09 9:37
stianhh22-Nov-09 9:37 
GeneralRe: Error during compilation that I dont understand. Pin
Richard MacCutchan22-Nov-09 11:41
mveRichard MacCutchan22-Nov-09 11:41 
AnswerRe: Error during compilation that I dont understand. Pin
Cedric Moonen22-Nov-09 3:58
Cedric Moonen22-Nov-09 3:58 
QuestionCode snippet for searching a file in directory (directory can have subdirectories in it) Pin
V K 221-Nov-09 19:16
V K 221-Nov-09 19:16 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
22491721-Nov-09 19:47
22491721-Nov-09 19:47 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
breezes2008_22-Nov-09 0:35
breezes2008_22-Nov-09 0:35 
AnswerRe: Code snippet for searching a file in directory (directory can have subdirectories in it) Pin
T210222-Nov-09 12:28
T210222-Nov-09 12:28 
QuestionConverting "C++" language code code to "C" language code. [modified] Pin
hivicky21-Nov-09 17:55
hivicky21-Nov-09 17:55 
AnswerRe: Converting "C++" language code code to "C" language code. Pin
Rajesh R Subramanian21-Nov-09 18:29
professionalRajesh R Subramanian21-Nov-09 18:29 
AnswerRe: Converting "C++" language code code to "C" language code. Pin
Richard MacCutchan22-Nov-09 1:58
mveRichard MacCutchan22-Nov-09 1:58 
AnswerRe: Converting "C++" language code code to "C" language code. Pin
tyftyftyf22-Nov-09 17:44
tyftyftyf22-Nov-09 17:44 
QuestionHow to initialize a modal dialog's controls? Pin
timbk21-Nov-09 11:38
timbk21-Nov-09 11:38 
AnswerRe: How to initialize a modal dialog's controls? Pin
timbk21-Nov-09 13:07
timbk21-Nov-09 13:07 
QuestionNumber Matching Pin
Humayun Kabir Hemoo21-Nov-09 0:19
Humayun Kabir Hemoo21-Nov-09 0:19 
AnswerRe: Number Matching Pin
Rozis21-Nov-09 1:49
Rozis21-Nov-09 1:49 
AnswerRe: Number Matching Pin
T210221-Nov-09 2:37
T210221-Nov-09 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.