Unable to include files in Visual Studio 2013 - c++

Recently I have been trying to setup SDL2, but I have come across an issue.
I have added the directory to the include folder into my project's Include Directories, added the directory to the lib folder to my project's Library Directories and added the .lib files to my project's Additional Dependencies. The issue is though that whenever I try to do something like #include <SDL.h>, it gives off a "cannot open source file" error.
Though if I do a #include <iostream> or something, it will work.
Any help? Thanks in advance.

Have you tried #include "SDL.h"?

Related

Cannot open source file "GL/glew.h"

I'm getting into OpenGL and Visual Studio, and just got this warning and couldn't find any possible solution. I've added both GLEW and GLFW Libraries to the include directory, and then again in the input section of the Linker menu, in the project's properties. Anyways, Visual Studio seems unable to find any of them.
See these images - they explain it all.
Include Directories:
Linker Input:
The Problem:
GLEW Directory:
GLFW Directory:
All image link together
It's because your include directories should be pointing to where the header files are, not the .lib files.
Change your include directory to go to where the .h files are located, for me it's C:\...\glew-2.0.0\include\GL
The directories you currently have in it should instead go into Additional Library Directories located at linker->general in your options

Using header files with multiple projects in same solution

I'm using C++ and visual studio 2015. I've created 2 projects in 1 solution. The first project is a static library and the other a DLL. I want to include one header file from the static library to use it in the DLL. I tried specifying the path to the header file with - Project->Properties->C/C++ -> General -> Additional include directories but it doesn't work. When I try to include the header file I get a red underline saying "cannot open source file "SomeHeaderFile.h".
Thanks for the help.
Thanks for the tips but I found out how to make it work. The DLL is in a extra folder. All I had to do was #include "../../TheHeaderFileThatISpentHoursTryingToGet.h". I deleted the reference in the additional include directories path and it still works. I always thought that it made sense for files from different projects in the same solution to be accessible throughout all the projects. Thanks again.

How to import libusb dll

I am using Visual Studio 2013 and have troubles using libusb dll. I have downloaded their source and compiled the dll version under release. New folder was created: D:\libusb-1.0.9\Win32\Release\dll which contains the .lib and .dll files. The next thing I did, was copied the .dll to my Visual studio projects folder, where the source files reside.
In Visual studio I then did: project->properties->linker->input->additional dependencies and pasted in the path to .lib file: D:\libusb-1.0.9\Win32\Release\dll\libusb-1.0.lib. Then I did project->properties->linker->general->additional library directories and pasted in the folder where the libusb header files are: D:\libusb-1.0.9\libusb.
Then I tried including the #include "libusb.h" but it says it cant find the file.
What else do I need to do, to make it work...?
EDIT:
These are the exact errors:
Cannot open include file: 'libusb.h': No such file or directory
IntelliSense: cannot open source file "libusb.h"
The problem is you did not add the folder containing the header file libusb.h to the include folders for your compiler. As a result the compiler can not find libusb.h since it is not in any of the folders the compiler searches.
In Visual Studio to add a folder to the include directories open the project properties for your target and add the folder to the C/C++->General->Additional Include Directories setting.

Add OpenSSL static libraries to a vc++ project

I have some problems adding the OpenSSL libraries to my visual vc++ project.
I tried everything I could find but I am still unable to include any .h files in my code.
I have a directory where I put my .lib (libeay32.lib and ssleay32.lib) libraries in a sub directory of my project called "Lib". I also have a environment variable pointing to my OpenSSL installation folder called "OPENSSL". Here's some screenshots of my project's config:
Still with all that if I write #include "rsa.h for example, Visual Studio tells me it doesn't exist. What did I miss?
Have you tried including like this:
#include <openssl/rsa.h>
or
#include <rsa.h>
Which proper way of including is the first one, unless you've added inside of openssl folder in your include path

C++ 2010: using #include <mysql.h>

I have searched like crazy and cant find an answer. I am trying to use mysql in my c++ project and have #include mysql.h but I need that directory file. Does one exist? I got all my code set up but zilions of errors because the file is missing. I'm following a tutorial but they dont explain where to get that directory. Any help would be great. Thanks!!
I know that that I am too late to post the answer, but just documentation purposes and for those who search for the same error.
Download the mysql server. You can download it from here: http://www.mysql.com/downloads/
Downloading the community server is just enough. Note: choose the zip file. Choose the x32 since the compiler is automatically configured to build with x32 configuration. If you intend to change the compilation configuration to x64, then go ahead and download the x64 zip file.
After download the zip file, create your new blank project. If you are using MSVC++Express2010, Open the project properties | C/C++ | Additional Include Directories. Add the path to the include folder found in the extracted folder.
Copy the library files found in lib folder in the extracted folder to the project directory where you can find your *.cpp files.
Add the following lines to your code:
#include <my_global.h>
#include <mysql.h>
#pragma comment(lib, "libmysql.lib")
Now you are ready to go :)
You can try the code found here to see if things went right or not.