Setting up Windows SDK in VS2012 Windows7 - windows

I'm trying to set up Windows SDK for DirectX11 but having a bit of trouble.
I'm on Windows7 with Visual Studio 2012.
The error I'm getting is:
1>TRACKER : error TRK0005: Failed to locate: "fxc.exe". The system cannot find the file specified.
So I assume it isn't locating the SDK correctly (I think it's an HLSL error).
So far in my project directories I have:
Include directories: $(WindowsSDK_IncludePath)
Library directories: $(WindowsSDK_LibraryPath_x86)
Library WinRT directories: $(WindowsSDK_MetadataPath)
I've checked where these macros go, and they go to the right place:
C:\Program Files(x86)\Windows Kits\8.0\etc...
which is where I installed it, however the error I wrote above is still showing up.
I'm stumped as to what to do next, could anybody help?

It is located in C:\Program Files(x86)\Windows Kits\8.0\bin\x86\fxc.exe, first check if it is there.
The VS setting that matters is Project + Properties, VC++ Directories, Executable Directories. It normally includes $(WindowsSDK_ExecutablePath_x86) so should never have a problem locating the file.

Related

Linking errors with boost, VS2010, and CMake

I have searched high and low for this answer. I have tried suggestions to similar problems posted on Stack and other sites. My toolchain consists of an x64 machine with windows 7, visual studio 2010, opencv 2.4, qt 4.8, and boost. I configure all of my projects using CMake, which finds all of these libraries and includes and creates my visual studio project. I have compiled two versions of boost, a 32-bit version build in the command line and placed in \boost\boost_1_47_0\lib\win32, and a 64-bit compiled in the Windows SDK v7.1 64-bit compiler and stored in \boost\boost_1_47_0\lib\x64. Everything in the project compiles fine with the exception of boost. I get a compiler error:
fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-1_47.lib'
As a reminder, CMake is handling all of my linking and it properly locates this lib and adds it to the visual studio project. I can verify this by looking at Properties->Linker->Command Line. Here, in addition to files representing other libraries, it has listed:
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_filesystem-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_program_options-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_date_time-vc100-mt-1_47.lib"
"C:\Tools\boost\boost_1_47_0\lib\x64\boost_thread-vc100-mt-1_47.lib"
I can suppress this error by manually adding my boost\boost_1_47_0\lib\x64 directory to Properties->Linker->General->Additional Library Dependencies. This compiles without error. However, when I go to run the application, I am met with a system error that tells me:
The program can't start because boost_filesystem-vc100-mt-1_47.dll is missing from your computer. Try reinstalling the program to fix this problem.
In this /x64 directory I have:
boost_filesystem-vc100-mt-1_47.dll
boost_filesystem-vc100-mt-1_47.lib
libboost_filesystem-vc-100-mt-1_47.dll
Any insight would be incredibly appreciated. Thanks!
To solve the runtime error:
Add the location of the dll(s) to the PATH environment variable.
For example on my machine:
set PATH=%PATH%;c:\users\chris\boost_regex-vc140.1.63.0.0\lib\native\address-model-32\lib
or copy the dll(s) to a directory already in the PATH
See here: https://msdn.microsoft.com/en-us/library/7d83bc18.aspx?f=255&MSPPError=-2147217396

Trouble building Boost Libraries

OS: Win7
IDE: Visual Studio 2010 Professional
Boost Lib Version: 1.47
Downloaded "boost_1_47_setup.exe" installer from http://www.boostpro.com/download/
Initially installed everything for VS 10, then just checked every box (5+ GB install!)
Added the "boost\boost_1_47" path into "Additional Include Directories" in C++->General
Copy/Pasted code from "Getting Started on Windows: 4 - Build a Simple Program Using Boost"
Compiled without issue
Included boost/regex.hpp and re-compiled
Received Error:
LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc100-mt-gd-1_47.lib'
Expected, haven't built the binaries yet.
Ran "Visual Studio Command Prompt" from tools folder in my VS 10 installation as admin
cd'ed to boost root
Ran bootstrap.bat from command line
Received Error:
Building Boost.Build engine
The system cannot find the path specified.
'.\build.bat' is not recognized as an internal or external command,
operable program or batch file.
Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.
Everything I did came from the Getting Started page on Boost.org. Not sure if its just dated or if I'm doing something wrong.
Came here looking for answers, found some similar issues, namely the following:
Problem with C++ Boost installation (can't find file) in VC++ 2010
Problem with C++ Boost installation (can't find file) in VC++ 2010
Boost C++ Libraries linker error libboost_serialization-vc100-mt-gd-1_47.lib
Boost C++ Libraries linker error libboost_serialization-vc100-mt-gd-1_47.lib
No dice. Any help would be appreciated. Thanks
The compiler cannot find the BOOST's library file. To fix the issue you have to find on your computer the libboost_regex-vc100-mt-gd-1_47.lib file and add its folder path to the Project->YourProjectName Properties (Alt+F7)->Configuration Properties->Linker->General->Additional Library Directories. After recompile your project.
This is the answer to the above comment of #Johnny 5....thousand. In VS10 the compiler-wide additional libraries are deprecated. I solved the problem by adding a new project property sheet to all my projects. It is possible to do it by calling the Property Manager Tab (View->Property Manager). In the Property Manager Tab is necessary to click right mouse button on the project, select Add New Project Property Sheet, Save the sheet to a well-known place. After to define a new User Macro - Name:BOOST, Value: Your Boost Path, for example c:\boost_1_47_0\, also add the $(BOOST) to the Additional Include Directories and ad the $(BOOST)\lib to the Additional Library Directories. That's all. For all other projects is required to add existing property sheet.

Visual Studio 2010 can't see /bin library of OpenCV

I'm trying to use OpenCv 2.2 in Visual Studio 2010.
I've configured everything by instruction:
http://opencv.willowgarage.com/wiki/VisualC%2B%2B
and by instruction from the book:
So I've added all /lib and /include paths.
When I build project, it compiles and before starting app, VS displays an error message that opencv_core220d.dll is missing.
This file is in C:/OpenCV2.2/bin as all .dll files. If I add this file to my working directory - it will be fine. Then VS displays error about every .dll file that I added in Linker-Input configuration ( but with .lib extension ).
So, if I add all .dlls file that I've added as .lib in Linker configuration - to my working directory, project will start.
But why? Why VC doesn't see OpenCV2.2/bin folder? Where is this pointed?
Because it doesn't know to look there by default. However, it does know to check the current directory for the DLLs.
You can tell it where to look by adding C:/OpenCV2.2/bin to your Path variable, or if you would rather not muck up your global Path you can set the Environment variable local to the C++ project.
I think that is the syntax for appending to the Path in VS2010, but I'm not sure, so Google it if that doesn't work :)

Building Qt for Visual Studio 2010 - cannot open file 'qtmaind.lib'

I'm trying to start a C++ Qt application and have it run and compile in Visual Studio 2010.
Doing some googling, I found that there was a Visual Studio Qt Add-in, and so I installed this. I already had a MinGW Qt binary installed, and when this did not work, I found that you have to compile the source for Visual Studio 2010 (the VS 2008 binary will cause deployment issues).
Using this as a guide: How to build Qt for Visual Studio 2010, I compiled the open source version, and added it to the PATH, along with a QTDIR env variable. Hoping that I got it finally working, I created a "Qt Application" using the New Project Wizard in Visual Studio 2010. Once I finished, I tried to build the program, only to see the following error:
1>LINK : fatal error LNK1104: cannot open file 'qtmaind.lib'
I looked in the C:\QT\lib folder, and found that I only have a qtmaind.prl, but no clue as to why there is no qtmaind.lib.
I am able to echo the QMAKESPEC environmental variable to get a 'win32-msvc2010' output.
I've tried several different combinations of flags for the configure step, including the one in the link, and even tried manually setting the -platform flag.
If anyone can offer any help, it would be greatly appreciated! :D
Just ran across this same problem. I changed the "-release" flag from the linked guide to "-debug-and-release", and then it built the qtmaind.lib library (presumably, that "d" suffix stands for debug).
I encountered this issue when running a project whose settings were hardcoded for a particular machine setup.
I could see that the vcxproj file had something like:
C:\Qt\4.8.1\libqtmaind.lib
I could not find this lib file in my machine. I replaced the line by:
C:\Qt\4.7.3\lib\Qtmaind.lib
It looks like the names of library files are different across Qt versions.Or, maybe the library files were renamed.
Also, the 'd' denoted debug. If you cannot find any lib file post-fixed by 'd', it is likely that you did not 'make' a debug version of Qt.
You can cross check this by opening the .Sln file created by configure. Mine was named Projects.sln. You can open this in notepad and see if win32-debug configurations are present.
This might be a QMAKESPEC issue. Try setting your QMAKESPEC environment variable to
win32-msvc2010
and rebuild Qt like that. This should give you .lib files in your Qt folder
in QT 5.3 with vs 2013
in properties -> linker -> input
remove ANY path for qt libraries such qtmaind.lib
this is known BUG

Cannot open include file "d3dx9.h"

Edit: Of course, immediately after working on it for an hour then posting here, I found the stupid mistake...
I'm getting compiler errors when trying to #include <d3dx9.h> in a project. I'm receiving "fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory".
I do have the DirectX SDK installed (I also just tried reinstalling it to no avail).
In the Project Properties:
VC++ Directories are set to "$(DXSDK_DIR)Include;$(IncludePath)" and "$(DXSDK_DIR)Lib\x86;$(LibraryPath)" for Include and Library directories respectively for all configurations—and the environment variable %DXSDK_DIR% points to C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\ as expected.
C/C++ > General settings has $(DXSDK_DIR)include listed in the Additional Include Directories
Linker > Input > Additional Dependencies has d3dx9d.lib included for Debug and d3dx9.lib included for Release configuration.
I am able to successfully compile and run tutorial projects from the DirectX Sample Browser.
Visual Studio's Intellisense/autocomplete will find d3dx9.h and suggest type and function names that are within the file (and not included through anything else I'm #includeing) so it seems that Intellisense can find it.
Any suggestions on what I'm forgetting or what else to try?
Thanks
you forgot one thing:
Go to VC++ Directories -> Library Directories
add $(DXSDK_DIR)LIB\x86
apply.
Done. Hope this helps
You should make sure you have ALL paths sorounded by quotes (").
Instead of $(DXSDK_DIR)include you should have "$(DXSDK_DIR)include"
I didn't realize that one of the other projects in the solution was #includeing a file that was #includeing a file that was #includeing d3dx9.h and I hadn't added those paths to that project.
/facepalm
Find the file on your computer, and add it's folder to the properties of your project.
Assuming you have visual studio: Properties/C/C++/General/Additional Include Libraries.
I tried all of these suggestions and none worked.
Turns out the $(DXSDK_DIR) variable doesn't work if you install DirectX while Visual Studio is still running. The solution for me was to restart Visual Studio (+ adding the paths in the solutions listed above, of course).

Resources