0
\$\begingroup\$

Well, i have been online for hours looking for solutions, but i have found none. Im looking for a way to create textures without the function D3DXCreateShaderResourceViewFromFile. Since D3DX is deprecated i figured that DirectXTK was the way to go since it is supported officially. I found that i could use the function CreateWICTextureFromFile, but whenever i use it i get the following linker errors: LNK2038 mismatch detected for '_MSC_VER' value 1800 doesnt match value 1900 in

LNK2019 unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base12@std@QAEXXZ referenced in function "public: void __thiscall std::_String_alloc<0,struct std::_String_Base_types>>::_Free_proxy(void)".......

any idea why is this happening? (i have both the header included and the DirectXTK.lib library linked into the project)? and is there any simpler way to create textures, without the added whole library just for 1 function?

\$\endgroup\$
2
\$\begingroup\$

The error message indicates that you are mixing static libraries built with one version of Visual C++ (VS 2013) with code built with a different version (VS 2015). This is because the Standard C++ Library cannot be 'mixed' in the same application.

If you are using VS 2015, then you should pick the appropriate vcxproj for your platform and toolset using project-to-project references:

  • DirectXTK_Windows10 is for Windows 10 UWP built with VS 2015
  • DirectXTK_Desktop_2015 is for Windows desktop apps built with VS 2015 with 'down-level' compatibility for Windows 7
  • DirectXTK_Desktop_2015_Win10 is for Windows desktop apps built with VS 2015 that requires Windows 10 or later--this config mostly exists for test purposes.

See the DirectX Tool Kit wiki for details.

NuGet packages for VS 2015 are now published for UWP and Windows desktop.

|improve this answer|||||
\$\endgroup\$
0
\$\begingroup\$

Probably the .lib file was compiled on a different version of Visual Studio. I don't know about DirextXTK but some library distributions contain multiple versions of libs for different compilers.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ I see. the documentation says that its designed to work with visual studio 2010/12/13/15 (i have 15), so idk whats up with that. other than this particular problem i am completely stumped on how to even continue with directx if the API is getting this inconsistent that you need external libraries just to load textures. \$\endgroup\$ – asdfguy Jun 25 '15 at 12:43
  • \$\begingroup\$ OpenGL does not have a texture file format built-in either. it's not an issue of the API... \$\endgroup\$ – Chuck Walbourn Jul 31 '15 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.