|
|
|||||||
| About Us | Register | FAQ | Members List | Calendar | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#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... |
|
|
|
|
|
#2 (permalink) |
|
NSBQ nut
![]() ![]() ![]() ![]() ![]() 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 |
|
|
|
|
|
#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... |
|
|
|
|
|
#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... |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|