Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old September 22nd, 2002   #1 (permalink)
Registered User
 
Join Date: Sep 2002
Location: Boondocks of NY
Posts: 8
directx linker error

i have been programming c++ for awhile now, and recently decided that it was time to move past windows and make purdy things with dx8, so i bought myself a book and downloaded the SDK and everything... when i compiled my first program, however, i got this linker error:

Directx Graphics error LNK2019: unresolved external symbol _Direct3DCreate8@4 referenced in function "public: long __thiscall D3DWindow::SetupDirect3D(void)" (?SetupDirect3D@D3DWindow@@QAEJXZ)

now i know that that error means that i probably misspelled something, but i double checked everything... in desperation, i tried to compile the first tutorial in the SDK, but that 2 gave me the same link error - funny thing is, when i compile advanced samples from the SDK sample base, they link fine, which means im linking the right files i think...

the only thing i can think of is that im using c++ .net, and the directx SDK was designed for c++ 5 or 6 ... could that be the problem? any ideas anyone?
__________________
hmm i used to make cool sigs, but that was when angelfire allowed remote loading... now im too cheap to pay for bandwidth, oh well...
Red Knight is offline   Reply With Quote
Old September 22nd, 2002   #2 (permalink)
NSBQ nut
 
Nezzar's Avatar
 
Join Date: Aug 2001
Location: .de
Posts: 1,208
I recently got a little bit into this whole .net-stuff and read about several linker-switches concerning switching .net-stuff on/off. Maybe there's a switch you left on. (Just a guess.)
__________________
Bred for its skills in magic
Nezzar is offline   Reply With Quote
Old September 23rd, 2002   #3 (permalink)
Banned
 
Ninjaa's Avatar
 
Join Date: Oct 2001
Location: Soviet Canuckistan
Posts: 0
did you make sure to include the D3D library in your project? (That one caused similar problems for me a while back)
Ninjaa is offline   Reply With Quote
Old September 23rd, 2002   #4 (permalink)
Registered User
 
Join Date: Sep 2002
Location: Boondocks of NY
Posts: 8
yes i did - i have both the library files and the include files referenced... i know for sure that they are working because i can compile the advanced D3D samples in the SDK, like the water demo or the dolphin demo, but when i try to write the most basic of D3D windows (create a blank window which does nothing but write to the backbuffer) i get that linker error - it doesn't apparentally like the Directx8::Create function, cause thats where the error is occuring, actually its these two lines exactly:

HRESULT D3DWindow::SetupDirect3D (void)
{
/* Create the Direct3D object */
if( NULL == ( g_pD3D = Direct3DCreate8( D3D_SDK_VERSION ) ) )
return E_FAIL;

//those two lines in this class create the error, nothing else...

/* Get the current display mode so we know what bitdepth we are */

D3DDISPLAYMODE d3ddm;
if (FAILED (g_pD3D->GetAdapterDisplayMode (D3DADAPTER_DEFAULT, &d3ddm) ) )

{
return E_FAIL;
}

/* Fill in the present parameters */
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory( &d3dpp, sizeof(d3dpp) );
/* We want windowed mode */
d3dpp.Windowed = TRUE;
/* Discard this */
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
/* Same format as the current format
(we got this from g_pD3D->GetAdaptorDisplayMode) */
d3dpp.BackBufferFormat = d3ddm.Format;

/* Create the device */
if (FAILED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,
m_hWindow,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&g_pD3DDevice ) ) )
{
return E_FAIL;
}

return D3D_OK;
}


i mean thats nothing comlex at all... now so i think it was a problem with my program, so i go and compile the very first sample in the SDK tutorial series, and that is essentially an exact copy of this program, and it gives me the same linker error... so i guess it has to be a compatibility problem between the SDK (designed for c++ 6) and .net, but i have no idea how to fix it...


oh nezzar what do you mean about linker-switches??? i don't know anything about ordering the linker around, aside from link this, lol
__________________
hmm i used to make cool sigs, but that was when angelfire allowed remote loading... now im too cheap to pay for bandwidth, oh well...
Red Knight is offline   Reply With Quote
Old September 23rd, 2002   #5 (permalink)
NSBQ nut
 
Nezzar's Avatar
 
Join Date: Aug 2001
Location: .de
Posts: 1,208
By switches I mean there are several (command-line?) switches that change the behaviour of the linker concerning .net-stuff.
__________________
Bred for its skills in magic
Nezzar is offline   Reply With Quote
Old September 25th, 2002   #6 (permalink)
Registered User
 
Join Date: Sep 2002
Location: Boondocks of NY
Posts: 8
oh i understand what you mean - actually im trying to get around the linker error by using the "/force" switch on the command line to force it to link despite the external error... i'll get back to you guys after i try it...
__________________
hmm i used to make cool sigs, but that was when angelfire allowed remote loading... now im too cheap to pay for bandwidth, oh well...
Red Knight is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 21:19.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5