fatal error: Eigen/Dense: No such file or directory in VSC - c++

I am beginner-programmer and I wanted to run a code which includes “Eigen/Dense” library. However, I could not add this library into the Visual Studio Code (VSC). I followed the following instruction, but it did not work.
• Open command panel (Shift+CMD+P on OSX or Shift+Ctrl+P on Windows and Linux).
• Search for 'Extlibraries: Add external library' and press Intro.
• Input external directory or file path (here I entered the path of Eigen directory which I download from its website).
• Input name and press Intro (here I entered Eigen)
Could you please help me with this problem? I am waiting for your responses.
Thank you

Eigen is a header only library. That means that there is no library binary that needs to be linked. As such, you just have to make sure that the Eigen directory is correctly placed in your include paths. So, if you have the Eigen/Dense file is located at C:\some\path\to\Eigen\Dense, then the included path needs to be C:\some\path\to\.

Related

Cannot open include file even when given the right path

I've been testing some stuff in Visual Studio after some time not working with VS, And I ran into a problem where I include a file and I get this error:
Cannot open include file 'spdlog/spdlog.h': No such file or directory
but I have the right path, in Project settings I have the right path set as an additional Include directory and the file is there. but the Thing is, when I take the file and move it one directory up and change the include path so that it now points one directory up (where the file is now) it suddenly works. Example:
File Path: Project/lib/spdlog/spdlog.h
Include directory: Project/lib
this Works
File Path: Project/lib/spdlog/spdlog/spdlog.h
Include directory: Project/lib/spdlog
This doesn't work
I don't want to include the lib directory since I have more libraries in it and it would just mess some stuff up, so I want to include every library (like spdlog for instance) separately. Does anyone know what might be causing the issue ? Also the error isn't shown when writing the code only when I try to build the Project.
Maybe you are missing spdlog library.
I suggest you check out this issue.
For debian-like distros you should be able to download it via apt-get: apt-get install libspdlog-dev.

How to resolve missing Lua DLL when using LuaBinaries and LuaBridge?

I'm trying to embed Lua into C++ (and learn Lua), starting off with Elias Daler's training wheels method here. I'm using MSVC 14.0, LuaBinaries 5.3.2 - Release 1 (specifically, lua-5.3.2_Win32_dllw4_lib.zip here), and LuaBridge 2.0.
I've added the following Additional Include Directories:
C:\lua-5.3.2_Win32_dllw4_lib\include;C:\LuaBridge
And the following Additional Dependency:
C:\lua-5.3.2_Win32_dllw4_lib\liblua53.a
And I'm using the following source (pared down as far as it can):
#include "stdafx.h"
#include <LuaBridge.h>
int main() {
luabridge::lua_State* L = luabridge::luaL_newstate();
}
That source compiles and links fine, but the application itself causes a standard missing DLL system error:
The program can't start because lua53.dll is missing from your computer. Try reinstalling the program to fix this problem.
lua53.dll is in C:\lua-5.3.2_Win32_dllw4_lib\ —what am I missing?
According to the official Microsoft documentation, Windows searches for DLLs in the following directories:
The directory where the executable module for the current process is located.
The current directory.
The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
The directories listed in the PATH environment variable.
So, one way to solve the problem would be to add C:\lua-5.3.2_Win32_dllw4_lib to the current user's PATH.
Compared to the other options, this has the advantages of not requiring admin privileges and not requiring lua53.dll to be in either the current directory or the same directory as your executable.

compiler error - opencv2/highgui.hpp: No such file or directory

I am a "very" beginner of OpenCV. I just downloaded it for my Windows and extracted.
I have read this post: http://opencv-srf.blogspot.ro/2011/09/capturing-images-videos.html about how to read webcam and I copied and pasted the code in a C++ file I created in "include" folder of OpenCV extracted archive.
When I try to run the program I get this error: Error in: /opencv/build/include/opencv2/highgui/highgui.hpp - opencv2/highgui.hpp: No such file or directory.
What should I do?
Thank you all!
EDIT
I opened: "/opencv/build/include/opencv2/highgui/highgui.hpp" and I can see that it includes this path "opencv2/highgui.hpp". If I change it to "../highgui.hpp" it works but I get other errors like this for other files... What should I do?
The problem is that you are not supposed to create your "cpp" file in the OpenCV "include" directory. You need to create it in a separate directory and then add OpenCV "include" as additional include directory for the compilation step.
The way to achieve this depends on your C++ development environment. If you are using Visual Studio, then you need to open project property pages, go to "C/C++ -> General" and add the path to OpenCV "include" directory to "Additional Include Directories". In case of some other compiler/IDE, you can find out how to do this by reading the corresponding documentation.

Cannot open include file: 'occi.h': No such file or directory

I am trying to compile an existing C++ project but get this error:
fatal error C1083: Cannot open include file: 'occi.h': No such file or directory
What I did is I went to this link:
http://www.oracle.com/technetwork/topics/winsoft-085727.html
and downloaded the first (basic) package.
Then unzipped the folder and modified PATH variable like this:
C:\Program Files\Atmel\sam-ba_2.12\drv\;C:\Program Files\Atmel\sam-ba_2.12;C:\Program Files\ATMEL Corporation\AT91-ISP v1.4\Library;C:\MSYS\1.0\bin;C:\MSYS\1.0\local\bin;C:\cygnus\cygwin-b20\H-i586-cygwin32\bin;D:\instantclient_12_1
last being path to oracle.
But I still get the error, can someone help?
PS I noticed in my project there are lines like:
#include "occi.h"
Maybe it is because of this?
The basic package isn't enough. Its description says "All files required to run OCI, OCCI, and JDBC-OCI application" (emphasis added); with just that you can run an OCI program, but you can't compile one. You need to download other instant client components. Specifically for the occi.h header you need the fifth file listed:
*Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
If you download and unzip that in the same place you unzipped the basic package, your instant client directory will gain an sdk folder, which includes all the OCI header files.
You'll then need to compile with -I D:\instantclient_12_1\sdk\include so your compiler knows where to look for the occi.h and other header files. You may also need -L to tell it where to find the Oracle libraries; presumably you already have -lclntsh and/or -locci, which refer to libraries you should have already from the basic package.

error can not open file in visual studio

I am getting the error of :
error LNK1104: cannot open file 'ylmtr.obj' in visual studio 2013
In the properties of my project I made the following configurations:
Linker - Input - Additional Dependencies- ylmtr
V/C++ Directories - added to the directories of include, library, source their configurations from the program parser generator (used to create lexer to make a compiler)
https://msdn.microsoft.com/en-us/library/ts7eyw4s.aspx
To fix by checking the following possible causes:
Not enough disk space.
File does not exist.
When specifying libraries in a project's property pages dialog box, library names should be separated by spaces (and not commas).
Incorrect filename or path.
Invalid drive specification.
Insufficient file permissions.
Path for filename expands to more than 260 characters.
If the given file is named LNKn, which is a filename generated by the linker for a temporary file, the directory specified in the TMP environment variable may not exist, or more than one directory is specified for the TMP environment variable. (Only one directory path should be specified for the TMP environment variable.)
If the error message occurs for a library name, and you recently ported the .mak file from a previous Microsoft Visual C++ development system, the library may no longer be valid. Ensure that the library still exists in this circumstance.
Another program may have the file open and the linker cannot write to it.
Incorrect LIB environment variable. For information on how to update the LIB environment variable, see VC++ Directories, Projects, Options Dialog Box . Make sure any directories with libraries you need are listed here.