Error C1083: Cannot Open Include file. File included properly in code - c++

So I've looked into this issue, and nothing has helped me so far. I've read numerous topics, many people say the same things about it not actually being able to find the file. In my project, I can right click the header where it is including (and giving the fatal error) and it will open the header file, everything loads works perfectly fine in the editor, but Visual Studio still tells me that the file cannot be found while compiling. I've double checked the spelling, I've added the double quotation marks around the includes and additional libraries, and removed them, and nothing is working.
I'm trying to include the header files for MySQL. I added and tried the include and library directories as well as libmysql.lib to the proper locations (Additional include directories, additional library directories, and Additional dependencies) with (to my knowledge) most combinations of directory paths.
The folder structure has the mysqlcon folder in the solution directory, and the project in its own folder. When I include the mysqlcon\include and lib folders. I tried:
..\mysqlcon\include
"..\mysqlcon\include"
$(SolutionDir)\mysqlcon\include
$(SolutionDir)\\mysqlcon\\include
Nothing seems to be working. I'm at a total loss. I even rebuilt the entire project today, got all the dependencies, references, build order, files, vcprojs redone, and I'm back staring at the same problem.

Found a solution... I'm not sure why it worked before, but I changed
#include "mysql.h"
to
#include "..\mysqlcon\include\mysql.h"
and it worked perfectly.

Related

How to fix "libopenblas.dll was not found" system error on visual studio C++?

I want to use the armadillo library in my C++ code. I downloaded it, and copied both the "include" and "lib_win64" folders into a new folder in my solution folder called "Dependencies".
The include folder contained another folder within which contained all the header files.
The lib_win64 folder contained "libopenblas.dll" and "libopenblas.lib".
Now, I opened up my C++ program in visual studio, went into project properties and changed these:
I added $(SolutionDir)Dependencies\armadillo\include in the C++->general->Additional include directories field
I added $(SolutionDir)Dependencies\armadillo\lib_win64 in the Linker->general->Additional library directories field
I lastly added libopenblas.lib to the Linker->input->Additional dependencies field
The C++ program builds successfully, but when I try to run it, I receive the system error: "The code execution cannot proceed because libopenblas.dll was not found. Reinstalling the program may fix this problem."
The initial armadillo download folder contains other folders, one being an example C++ program. I run that and it compiles and executes as it should, with no system error. So, I don't think the .dll file is corrupted or anything.
I was wondering if someone has maybe had a similar issue, or knows somewhere I may have messed up and can point it out.
Any advice would be much appreicated!

Eclipse can't resolve <includes> despite seeing them in project's Includes

I have a C project opened in Eclipse that uses a third party library. I added a /usr/local/include/ and /usr/include/ to the project's includes and the Project explorer window shows all required header files correctly.
The build also works fine but the Editor part of the ide doesn't seem to be able to resolve #include pointing to the 3rd party header files correctly.
I've tried restarting Eclpse and rebuilding the index. I've also tried both default settings and Enable project specific settings for indexer, nothing work. Individual source files don't have specific configuration.
Copying the header files to ~/devheaders and pointing Eclipse there solved the issue, no idea why. Permissions on the header files were fine.

IntelliSense: Cannot open source file in include path

I am authoring a C++ project with Visual Studio 2013 Professional and I encountered a problem I have never encountered before.
In one of my source files I am including a third-party header file like this:
#include 'sqlcli1.h'
This file (and other files of the same set) are located in a an external directory (not in the VS solution), so I have added it to the search path using Additional include paths under project's Properties.
The solution does build succesfuuly, so I am sure my external header file is referenced correctly. IntelliSense, however, still doesn't see it and complains about not being able to open source file 'sqlcli1.h'. It does not prevent me from building the project, but it makes editing it much harder.
Why does this happen and what should I do?
Have you tried to delete files related to Intellisense in your solution directory? Go to .vs\(your solution name)\v(VS version)\, delete Browse.VC.db and ipch directory. VS will rebuild the IntelliSense database and it may help solve your problem.
Alas, I did everything above but, to no avail. For me the problem is the *.vcxproj file. I took the contents of a working *.vcxproj file and replaced it with the one that didn't work (changing the project name in the *.vcxproj file, of course!!) And, Wowie Zowie!! It works! There is probably a much more elegant solution, but this worked for me. Also, my problem was related to a C1083 error, too.

cannot locate the .lib file VS12 is trying to open

So I am creating an app in VS2012 in MFC using an old Microsoft SDK (called VisSDK for machine vision) which worked fine with VS6. The problem is, I get this LNK1104 error, Cannot open file VisImSrcLibDB.lib.
I have done a search through the project for VisImSrcLibDB...but nothing came up. I have checked all the header files (external) and tried to see where is this being called.
I can presume (based on the name) that it seems to be part of the SDK, but cannot for the love of god figure out where is this being called from.
Any Help would be appreciated in this. Here is a screenshot:
PS: yes I have mapped the lib folder of the SDK under LINKER properties. and the corresponding include folder in the Additional Include directory.
If you haven't already, you should turn on the VS flags for verbose output. That should give some indication as to why things are being pulled into the build.
The VisImSrcLibDB.lib must exist some where in your VisSDK directory.
Use the PROJECT-Properties command, All configurations from the Configuration drop down list and add the directory containing the VisImSrcLibDB.lib file to the Library Directories in the VC++ Directories section.

Visual c++ 2008 express creating a library

I know many have asked this question, but following the things suggested hasn't seemed to work for me. So I thought I'd ask for help, as I'm obviously missing something.
I've spent the past couple days writing some code that uses the boost library that allows me to open text files, translate the text into a usable data format, and save the data as a text file when I'm done with it. I built it specifically to be extendable to deal with different datatypes (specifically any object or class I make down the line) so that I could link to it as a library in my project as I do other libraries.
However, even after compiling it into a lib and adding the directory of the lib to the "Additional Include Directories", I get an unresolved external error whenever I try to include one of the header files in the library. I've also tried putting the direct path to it under Additional Dependencies (as well as just the library name with the path to the directory set in Additional Include Directories and Additional Library Directories. I also tried it with only one of those on at a time and it still failed).
Is there something I'm missing? How can I compile this code I'd like to reuse and link to it in new projects without copying the cpp and h files into my solution every time? Would a DLL work better/easier? If so, how would I go about compiling it as a dll and linking to it?
Thanks for reading this wall of text. Any help you could provide would be great.
Ok. While it's not the exact solution I was going for, I managed to figure this out. For anyone running into this problem, there's a wonderful tutorial that explains how to make DLL files and make use of them (at least on windows, don't have any computers using an alternate OS set up yet to test the DLL on). You can find it here.
http://programmingexamples.wikidot.com/blog:1
The gist of the problem is you need to also keep a copy of the .h file handy to include in your project. (what I did is created a directory on my C drive that holds the libraries I'm making, and in that I have a folder for the .lib files and a folder for the .h files.) Either import the .h file directly into your project directory or add it to your project properties (C++ -> General -> Additional Include Directories ). Make sure for that, you're linking to the directory, not the file itself. In the linker, you need to add your .lib file to the Additional Dependencies section (Linker -> Input -> Additional Dependencies). You can put the whole path here, or you can just put the file name, then tell the program where to find the directory it's in (add the path to the directory to Linker -> General -> Additional Library Directories)
Hope this helps anyone else who managed to miss something that everyone else seems to understand instinctually :P