![]() ![]() # If you do want to change a value, simply edit, save, and exit the editor. # If you do not want to change any of the values, simply exit the editor. # For build in directory: e:/Projects/TestProject/Debug # It was generated by CMake: C:/Program Files/CMake/bin/cmake.exe # You can edit this file to change values found and used by cmake. ![]() ![]() This is the generated CMakeCache # This is the CMakeCache file. Set_target_properties ($ "C:/Program Files (x86)/Microsoft DirectX SDK/Lib/x86/d3dx11.lib") #set(CMAKE_CXX_FLAGS -G"NMake Makefiles")Īdd_executable(TestProject Source/main.cpp ) #set(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE)ĪDD_DEFINITIONS(-D_ENABLE_EXTENDED_ALIGNED_STORAGE) Thanks cmake_minimum_required(VERSION 3.13.0) Im assuming that since its failing at the linker stage, its finding all the headers correctly, The same project also builds with Visual Studio without issues, but I am trying to build with NMake The path for the library exists and the library is there: C:/Program Files (x86)/Microsoft DirectX SDK/Lib/x86 Maybe something is out of order or written incorrectly. However, the project requires d3dx11.lib and I cannot seem to get it to build, it fails at the linker stage I'm learning how to use CMake by making a basic CMakeLists.txt file without macros and targetting x86 only I see it's right there in the linker command line, wtf why can't it open? WHat does it mean when it says it cannot Open the lib file? Does it mean it's found but cannot be opened? Or that its not found? LINK : fatal error LNK1104: cannot open file 'd3dx10.lib' LINK Pass 1: command "C:\PROGRA~2\MIB055~1\2019\ENTERP~1\VC\Tools\MSVC\1425~1.286\bin\Hostx86\x86\link.exe /nologo u/CMakeFiles\example.dir\objects1.rsp /out:example.exe /implib:example.lib /pdb:E:\Projects\example\Debug\example.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console C:\Program Files (x86)\Microsoft DirectX SDK\Lib\x86\d3dx11.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\example.dir/intermediate.manifest CMakeFiles\example.dir/manifest.res" failed (exit code 1104) with the following output: ![]() I tried all of these optiosn, still getting the same error: Maybe the path doesn't need spaces, maybe Im supposed to have the library with a lib prefix, maybe Im not supposed to put the extension. The problem is I don't understand what CMake wants. I cannot keep trying to figure this out on my own anymore, I tried usin target_link_library, add_library, find library, you name it, it's in the CMakeLists.txt below I made several posts on stackoverflow but received no answers. Note that D3DX9, D3DX10, and D3DX11 are all deprecated (see Microsoft Docs) along with the DirectX SDK itself.I spent 3 days trying to figure out how to including the library in CMake, each time I build it gives me the same error. The DirectXTex implementation of HDR recognizes both ?RADIANCE and ?RGBE headers, but D3DX9 only supported ?RADIANCE. They both included support for DDS as well.ĭirectXTex includes a codec for TGA and HDR because they are common source texture formats, but are not supported by any built-in WIC codec. D3DX10/D3DX11 via WIC supports BMP, GIF, JPG, PNG, TIFF, and HDPhoto (JPEG-XR). You can find a modern DDSTextureLoader, WICTextureLoader, and ScreenGrab for legacy DX9 here which does not require D3DX9 at all.ĭ3DX9 includes codecs for BMP, JPG, PNG, TGA, HDR, and PPM/PFM. The D3DX10 and D3DX11 libraries use Windows Imaging Component ( WIC) which relies on a file inspection technique, so it wouldn't care what the physical file-name is. Since you told it jpg it will only try to load it using jpeglib. The D3DX9 library is very old, and it used the filename extension to determine which codec to use for loading the image. MessageBox(0, "E_OUTOFMEMORY", "dx9", MB_OKCANCEL | MB_ICONHAND) MessageBox(0, "D3DXERR_INVALIDDATA", "dx9", MB_OKCANCEL | MB_ICONHAND) MessageBox(0, "D3DERR_INVALIDCALL", "dx9", MB_OKCANCEL | MB_ICONHAND) MessageBox(0, "D3DERR_OUTOFVIDEOMEMORY", "dx9", MB_OKCANCEL | MB_ICONHAND) MessageBox(0, "D3DERR_NOTAVAILABLE", "dx9", MB_OKCANCEL | MB_ICONHAND) HRESULT hr = D3DXCreateTextureFromFile(Globals::g_pD3DDevice, XorStr(avatarFile), Globals::User::g_pAvatar) if (Globals::User::g_pAvatar = nullptr)Īuto s_avatarFile = Globals::g_sAppdataFolder "\\avatar.jpg" ĭownload(Globals::User::g_sAvatarUrl.c_str(), avatarFile) ĭ3DXCreateTextureFromFile(Globals::g_pD3DDevice, XorStr(avatarFile), Globals::User::g_pAvatar) D3DXCreateTextureFromFile does not work for me, i get the D3DXERR_INVALIDDATA error when i use XorString and the D3DERR_INVALIDCALL when i don't. ![]()
0 Comments
Leave a Reply. |