Jump to content
  • Advertisement

PedroMachin

Member
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

100 Neutral

About PedroMachin

  • Rank
    Member
  1. PedroMachin

    GetAdapterCount() always returns 0

    Yes, the interface is initiated. It only FAILED BuildDeviceList() (which called GetAdapterCount() unsuccessfully): HRESULT D3DApplication::InitializeDirect3D() { HRESULT hr; m_hWnd = GetAppWindow(); // Create the Direct3D object m_pD3D = Direct3DCreate9( D3D_SDK_VERSION ); if( m_pD3D == NULL ) return DisplayErrorMsg( D3DAPPERR_NODIRECT3D, MSGERR_APPMUSTEXIT ); if( FAILED( hr = BuildDeviceList() ) ) { SAFE_RELEASE( m_pD3D ); return DisplayErrorMsg( hr, MSGERR_APPMUSTEXIT ); } ..........
  2. [color="#1C2837"]Hello! I'm using the June 2010 release of DirectX on Visual Studio C++ 2010. [color="#1C2837"] After spending the whole day trying to make the project link (essentially ran into this problem [color="#1C2837"](http://www.gamedev.n...les-with-dx90c/)[color="#1C2837"]) now the project compiles, but I just get a black screen. I tracked down the problem to the GetAdapterCount() always returning zero and therefore not building a device list. I looked this up online, but I only found some reference to the OS sometimes being at fault in some systems?! Any ideas of where to go from here? [color="#1C2837"] HRESULT D3DApplication::BuildDeviceList() { const DWORD dwNumDeviceTypes = 2; const TCHAR* strDeviceDescs[] = { _T("HAL"), _T("REF") }; const D3DDEVTYPE DeviceTypes[] = { D3DDEVTYPE_HAL, D3DDEVTYPE_REF }; BOOL bHALExists = FALSE; //BOOL bHALIsWindowedCompatible = FALSE; BOOL bHALIsDesktopCompatible = FALSE; BOOL bHALIsSampleCompatible = FALSE; /* debug code UINT adapterCount = m_pD3D->GetAdapterCount(); if(adapterCount == 0) { return 0; <<<<<-------always exits here }else if(adapterCount == 1) { return 1; }*/ // Loop through all the adapters on the system (usually, there's just one // unless more than one graphics card is present). for( UINT iAdapter = 0; iAdapter < m_pD3D->GetAdapterCount(); iAdapter++ ) { // Fill in adapter info .........
  3. PedroMachin

    Linker Nightmares

    AverageMidget, I want to be able to figure these things out for myself and as such I appreciate the fact that you give explanations as opposed to just giving an answer. Ok, so in the case of D3DXLoadMeshFromX function, the closest that I could find to that function in the project code was the LoadMesh function in d3dfile.h I added d3dx9.lib to the linker requirements to no avail. Now, the msdn entry that you referenced says that d3dx9Mesh.h is also a requirement. I downloaded this header file from Koders.com, added it to the header's directory and #included it in the file where I'm actually loading the mesh file (However, the call that I'm making is: bool D3DModel::Load(LPCTSTR xFileName, LPDIRECT3DDEVICE9 dev) so I'm a bit confused how the D3DXLoadMeshFromX function is being called). What am I doing wrong? From reading some other posts it seems that sometimes you have to also add external .cpp files to the project such as d3dapp.cpp (not just headers and libraries), could that be the case here? In particular I read: http://www.gamedev.n...ng-a-dx-sample/ and tried importing the .cpp files suggested (d3dapp.cpp, d3dfont.cpp, d3denumeration.cpp) however, those files were not in my sdk download and if I try downloading them from Koders.com, the files seem to be out of date as they are calling non-existing headers. Thanks, and again excuse my noobishness.
  4. PedroMachin

    Linker Nightmares

    I moved on to another project, and are running into Linker problems again! Again, I[color="#1C2837"] am running on Visual C++ Express with the June 2010 release of DirectX. All the libraries added are listed below the output below: This time I get: 1>------ Build started: Project: Circle, Configuration: Release Win32 ------ 1>Circle.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFont::InitDeviceObjects(struct IDirect3DDevice9 *)" (?InitDeviceObjects@CD3DFont@@QAEJPAUIDirect3DDevice9@@@Z) 1>Circle.obj : error LNK2001: unresolved external symbol "void __cdecl D3DUtil_InitLight(struct _D3DLIGHT9 &,enum _D3DLIGHTTYPE,float,float,float)" (?D3DUtil_InitLight@@YAXAAU_D3DLIGHT9@@W4_D3DLIGHTTYPE@@MMM@Z) 1>D3DApplication.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DMesh::Create(struct IDirect3DDevice9 *,char *)" (?Create@CD3DMesh@@QAEJPAUIDirect3DDevice9@@PAD@Z) 1>D3DApplication.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFrame::Render(struct IDirect3DDevice9 *,int,int)" (?Render@CD3DFrame@@QAEJPAUIDirect3DDevice9@@HH@Z) 1>D3DApplication.obj : error LNK2001: unresolved external symbol "public: long __thiscall CD3DFrame::RestoreDeviceObjects(struct IDirect3DDevice9 *)" (?RestoreDeviceObjects@CD3DFrame@@QAEJPAUIDirect3DDevice9@@@Z) 1>D3DApplication.obj : error LNK2001: unresolved external symbol "long __cdecl D3DUtil_SetDeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *)" (?D3DUtil_SetDeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@@Z) 1>eisdk.lib(d3dfile.obj) : error LNK2001: unresolved external symbol _D3DXLoadMeshFromX@28 1>eisdk.lib(d3dfile.obj) : error LNK2001: unresolved external symbol _D3DXLoadMeshFromXof@28 1>eisdk.lib(d3dfile.obj) : error LNK2001: unresolved external symbol _D3DXComputeNormals@4 1>C:\Users\Pedro\Documents\Visual Studio 2010\Projects\Circle\Release\Circle.exe : fatal error LNK1120: 9 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Character set is Multibyte since I'm compiling older code I changed the RunTime Library to /MT (Multithreaded) and are running a Release build These are the classes under Linker/Input/Additional Dependencies: libcmt.lib dinput8.lib d3d9.lib dxguid.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib winmm.lib psapi.lib These are the classes under Linker/Input/Ignore: libc.lib msvcrt.lib libcd.lib libcp.lib libcmtd.lib msvcrtd.lib Under Linker/General/ Additional Library Directories: C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86 C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64 C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Lib Under VC++ Directories: Include: C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include Library Directories: C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86 C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include Thanks!
  5. PedroMachin

    Linker Nightmares

    Stupid Linker! Thanks AverageMidget. You guys are awesome!
  6. PedroMachin

    Linker Nightmares

    Thanks King, but dinput.lib does not exist, only dinput8.lib. Thanks for the suggestion
  7. PedroMachin

    Linker Nightmares

    Thank You, now things are starting to make sense.... However, when I #define DIRECTINPUT_VERSION as 0x0700, I realized that my program is actually using structures under the #if(DIRECTINPUT_VERSION >= 0x0800), such as the IDirectInputDevice8 struct. So, if I define version 0x0700, I get rid of the linker errors, but then I get a ton of compile errors. It seems that I need to define #define DIRECTINPUT_VERSION as 0x0800 given all the version 8 structures (or not define it at all since the version is defined automatically by dinput.h if there is no explicit version define, which apparently was what was going on before). Apparently, the problem is that "extern const DIDATAFORMAT c_dfDIMouse;" in the dinput.h file is not being linked to whichever external file it was defined! Like I showed in my original post in the linker command line, dxguid.lib is included in the linker. [/quote] I attached the whole project, just in case someone wants to take a gander...
  8. PedroMachin

    &c_dfDIMouse is UNRESOLVED? (DirectInput C++)

    Hi Deux Ex, did you ever figure out your problem? I'm having the same issue, dxguid.lib is included in the linker, however, I am still getting the Linker error. Thanks!
  9. PedroMachin

    Linker Nightmares

    Hello there, this is my first post here in GameInstitute, please be kind to my ignorace I am running on Visual C++ Express with the June 2010 release of DirectX. My problem: This declaration: const DIDATAFORMAT& pointerDataFormatAlias = c_dfDIMouse; Is causing the following Linker error: 1>eiInput.obj : error LNK2001: unresolved external symbol _c_dfDIMouse I have included <dinput.h> in the file as well as added it to my header files and included it in my project. I have added the following paths to the libraries under "Configuration Properties/VC++ Directories/Library Directories" C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x64 C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86 C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Lib I have added the following paths to the include directories under "Configuration Properties/VC++ Directories/Library Directories" C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Include C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86 I have added the relevant library directories under "Linker/General": C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x64;C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Lib;%(AdditionalLibraryDirectories) I have added the relevant (as far as I know) libraries themselves under Linker/Input: dinput8.lib;dxguid.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;ole32.lib;winmm.lib;psapi.lib;d3d9.lib;%(AdditionalDependencies) Just in case, I'm missing something important, this is the whole Command Line under "Linker" showing all the included libraries: /OUT:"C:\Users\Pedro\Documents\Visual Studio 2010\Projects\DirectInputScroll\Debug\DirectInputScroll.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x64" /LIBPATH:"C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86" /LIBPATH:"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib" "dinput8.lib" "dxguid.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "ole32.lib" "winmm.lib" "psapi.lib" "d3d9.lib" "winspool.lib" "advapi32.lib" "shell32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Debug\DirectInputScroll.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\Pedro\Documents\Visual Studio 2010\Projects\DirectInputScroll\Debug\DirectInputScroll.pdb" /SUBSYSTEM:WINDOWS /PGD:"C:\Users\Pedro\Documents\Visual Studio 2010\Projects\DirectInputScroll\Debug\DirectInputScroll.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE What the heck is going on?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!