I have installed direct SDK and I have visual studio 2010 , I started to write code and compile and when I run I get error of unresolved external symbols or some sort of this , I searched and I found that I need a library called legacy_stdio_definition.lib which I don't have in my files , note my code worked on other computer that have vs 2010
1 Answer
Based on the comments, you likely have misconfigured your x86 vs. x64 library paths for using the legacy DirectX SDK with VS 2010.
In the Project Settings under VC++ Directories.
For all configurations for the Win32 (x86) platform, you need:
Include: ``$(DXSDK_DIR)Include;$(IncludePath)``
Lib: ``$(DXSDK_DIR)Lib\x86;$(LibraryPath)``
Executable: ``$(DXSDK_DIR)Utilities\bin\x86;$(ExecutablePath)``
For all configurations for the x64 platform, you need:
Include: ``$(DXSDK_DIR)Include;$(IncludePath)``
Lib: ``$(DXSDK_DIR)Lib\x64;$(LibraryPath)``
Executable: ``$(DXSDK_DIR)Utilities\bin\x64;$(DXSDK_DIR)Utilities\bin\x86;$(ExecutablePath)``
Keep in mind that that legacy DirectX SDK is end-of-life. See MSDN and this blog post.
Note that the instructions above only work correctly for VS 2010 which uses the Windows 7.1 SDK. When using any newer version of Visual Studio that comes with the Windows 8.x SDK or Windows 10 SDK, you need to reverse the path order to use the legacy DirectX SDX.
-
\$\begingroup\$ Still the same error \$\endgroup\$Mohamed Hanafy– Mohamed Hanafy2017-05-22 21:50:37 +00:00Commented May 22, 2017 at 21:50
-
\$\begingroup\$ If I installed vs2015 , that error will never show? \$\endgroup\$Mohamed Hanafy– Mohamed Hanafy2017-05-22 21:57:51 +00:00Commented May 22, 2017 at 21:57
-
\$\begingroup\$ If you are using the legacy D3DX11 library, you have to use the old DirectX SDK. You can find replacements for all the old DirectX SDK only stuff for Direct3D 11 which would build with VS 2013 or later without the DirectX SDK at all. \$\endgroup\$Chuck Walbourn– Chuck Walbourn2017-05-23 00:00:03 +00:00Commented May 23, 2017 at 0:00
-
\$\begingroup\$ Thanks for help and support .early today I used code blocks IDE and loaded library automatically when I chose the SDK directory \$\endgroup\$Mohamed Hanafy– Mohamed Hanafy2017-05-23 15:12:25 +00:00Commented May 23, 2017 at 15:12
legacy_stdio_definition.libis only for VS 2015 or later which has the Universal CRT--it doesn't exist for the CRT used by VS 2010, VS 2012, or VS 2013. \$\endgroup\$