Visual studio 2008 Qt Project configuration - c++

I am trying to configure my dll project so that I can access QtCore4.dll and QtGui4.dll functions.
In my project properties under c/c++, Additional Include Directories I have added ...\Qt\4.6.0;
project properties under Linker Additional library directories I have added Qt\4.6.0\lib
Right, so what #include do I need to put in my header files so that I can get the functionality?
Before I was using dependencies and using the includes and but now I have removed the dependencies I am getting a 'cannot open file: 'QtCore/qcoreapplication.h': no such file or directory error.
This project is making me feel like a moron.
Thanks.

Your additional Include directory should be ..\qt\4.6.0\include. If you use qmake or the VS plugin all this is done automatically.

Save yourself time and hassle, get the plugin: http://qt.nokia.com/downloads

Related

C++ cannot open source file, additional directory listed

I am using Visual Studio 2019, and I'm trying to include codes from open source GLFW. Things were working completely fine, but when I tried to make another project based on this method again it's not working.
It shows 'Cannot open include file: 'GLFW/glfw3.h': No such file or directory'
I reproduced the steps to add GLFW and it worked well. You could check whether there are any missing steps.
Create a Dependencies folder in your project directory, copy the include and lib-vc2019 folders of glfw-3.3.2.bin.WIN32 to Dependencies.
Set Configuration to All Configurations and set Platform to Win32
Add $(SolutionDir)Dependencies\GLFW\include in Proeperties->C/C++->General->Additional Include Directories
Add $(SolutionDir)Dependencies\GLFW\lib-vc2019 in Proeperties->Linker->General->Additional Library Directories
Add glfw3.lib;opengl32.lib;User32.lib;Gdi32.lib;%(AdditionalDependencies) in Proeperties->Linker->Input->Additional Dependencies

How to add a library to my project in a visual studio 2019?

I needed to use zydis library in my VC2019 cpp project.
I have no idea how can I add it to my current project - I downloaded it from github.
There is msvc folder, inside I can find .sln file, some header files and .vcxproj files - what should I do, to just include it into my project and use it?
It can be done by adding a reference to the DLL file.
In Visual Studio, right click on the project, Add Reference. Give the path to the DLL file and add it to the project.
First, I suggest that you could download and install Zydis using the vcpkg dependency manager. The method is easy and convenient.
If you don't use vcpkg, you could follow the steps below.
Open the Zydis.sln in msvc with VS2019.
Copy files in include/Zycore, put them in zydis-master\include\Zycore. Because I find that there should be missing files when I compile Zydis.sln.
Right click Zydis, set Visual Studio 2019(v142) in Properties->General->Platform Toolset.
Compile it, and you will find Zydis.lib in zydis-master\msvc\bin\DebugX64.
Then, you could copy include floder and lib in your program floder.
You could set VS:
Right-click the project, select Properties->Configuration
Properties->C/C++->General, find the Additional Include Directories and set the directory.
Properties -> Configuration Properties -> Linker ->
General, find the Additional library directory in General, and set the lib.
Properties -> Configuration Properties -> Linker -> Input,
find Additional Dependencies and input the lib name.
Besides, you could set five build configurations.

How to add Include directories in Visual Studio while cross-compiling to a Raspberry Pi?

I'm working on a c++ project on my Raspberry Pi. I'm using Visual Studio 2017 to cross-compile the project to my Raspberry.
But when I try to compile the project, I get the error"cannot open source file" in lots of header files.
I already managed to compile simple projects, but now I need to Include Directories and I don't know the proper syntax to set, on Visual Studio's project properties page, the Include Directories to tell the compile where the header files are stored.
For the PCL library, e.g., I was able to include directories using '$(INCLUDE_PCL)'.
But when I try to include pi's directory '/usr/Include/ni' I can't correctly set the absolute path. Here's an screenshot of my properties page (https://ibb.co/G2dszrx). I haven't set the Linker directories yet, since I'm currently getting errors on the compiling phase.
Does anyone knows how to set absolute path to include directories correctly?
EDITED:
Trying to figure this out, I created a new project (Proj) in which I include the file 'try.cpp' stored in the raspberry's "home/pi/projects" folder. This project is in the "/home/pi/projects/Proj" folder.
In the project property page, I have:
Configuration Properties>General>Remote Build Root Directory --> ~/projects
Configuration Properties>General>Remote Build Project Directory --> $(RemoteRootDir)/$(ProjectName)
C/C++>General>Additional Include Directories --> $(RemoteRootDir)
When I compile the project this path gets created correctly, and the project is saved at the correct place, even if go further into more folders in the remote build project directory, but it can't find the include file "try.h".
How can Visual Studio know where to save the project using '$(RemoteRootDir)', but is not able to add that path include directory?
After some searching I managed to correctly add the Additional Include Directories, and Additional Libraries.
Firstly I was also using OpenNI, to work with the PCL. After many tries, I discovered that OpenNI was not correctly installed. So I managed to install it with apt-get.
Secondly, If you want to include the "/home/pi/someDIR" directory at the Raspberry device, just add "/home/pi/someDIR" to Visual Studio's additional include directories.
For you still trying to achieve this, Merlyn Oppenheim, from visual studio, set up a sample project using VS 2019 and Raspberry PI template -> https://github.com/merlynoppenheim/sample-rasp-inc-headers
For this sample project the Visual Studio properties page should have:
C/C++ -> General -> Additional Include Directories = '/home/pi/projects/vcpkg/packages/sqlite3_x64-linux/include;%(AdditionalIncludeDirectories)'
C/C++ -> Linker -> General -> Additional Library Directories = '/home/pi/projects/vcpkg/packages/sqlite3_x64-linux/debug/lib;%(AdditionalLibraryDirectories)'
C/C++ -> Linker -> Input -> Library Dependencies = 'wiringPi;sqlite3;pthread;dl'

Boost C++ Libaries in Visual Studio 2017 C++ Project - "Cannot open include file"

I'm trying to add the Boost C++ Libraries to my C++ project created with Visual Studio 2017.
I have followed the instructions here.
When that didn't work I tried the advice in this post. Neither solutions worked for me.
What I have done:
Downloaded boost_1_69_0-msvc-14.1-64.exe from this precompiled boost libraries page
Installed to D:\local\boost_1_69_0
In my project I added D:\local\boost_1_69_0 to Properties > VC++ Directories > Include Directories and added D:\local\boost_1_69_0\lib64-msvc-14.1 to Properties > VC++ Directories > Library Directories
I have my project set to x64 and the above settings were set in the x64 configuration
When I try to build my project I get this error:
Error C1083 Cannot open include file: 'boost/regex.hpp': No such file or directory
Which points to this line of code in one of my .cpp files:
#include <boost/regex.hpp>
Please go to D:\local\boost_1_69_0 folder and see if you have a sub-folder named include in there. If you do, then instead of D:\local\boost_1_69_0 you need to set D:\local\boost_1_69_0\include in Properties > VC++ Directories > Include Directories
In other words, try to find the file you are including on your hard drive. Look at the full path to the file. Compare that full path with the path you added to the list of include directories (Properties > VC++ Directories > Include Directories) concatenated with the relative path you provided just before the filename in your include directive (boost). See if the two are the same.
If that does not help, then make sure you changed list of include directories for the same build configuration as you are attempting to build (if you build Debug, make sure you changed configuration for Debug too). Since VS 2015 IDE stopped making sure the two are selected in sync, which is annoying.
If your files are copied, then you have to compile the regular library.... If the same version of the compiler copies the machine.
Found out it was failing because I had included the same .cpp file which has the boost include into my unit test project which did NOT have the Include/Library folders set. The settings in my original question work now.

Cannot open include file "windows.h" No such file or directory

I am trying to build a project which contain several C# projects and one C++ project in VS 2013.
But during build the above error is shown, then i googled the error and tried several things but unable to fix the issue.
Things i have tried:
1) Added Window 10 SDK's Include directory to the Additional Include Directories
in C/C++ Configuration properties.
2) Added Window 10 SDK's Lib directory to the Additional Library Directories into the Linker.
3) Making sure that include file is "windows.h" instead of "Windows.h".
Path of Windows.h file present locally in SDK directory is
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um
Does any have any idea how can i fix this ?
Any help will be appreciable.
Go to the project properties -> Configuration Properties -> General
then Change Platform Toolset to Visual Studio 2013- Windows XP(v120_xp).
This is what worked for me.