C++ Shogun library: Cannot locate shogun/lib/config.h file - c++

I am reading through the shogun C++ library code and while reading in the src folder, I notice that many files include the header file shogun/lib/config.h, but I cannot find this header file in the source code.
For example, if you look at the header file SGMatrix.h you can clearly see that it has the following include statement:
#include <shogun/lib/config.h>
yet you can't find config.h anywhere in shogun/lib. Where can I find this header file?

The config.h is being created during configuration, i.e. running cmake, and the actual content is based on your system's properties. the template of for the file can be found in src/shogun/lib/config.h.in

Related

how can include <> ignore system default header file path(usr/include)?

I have a c++ project where the build process is organized by cmakelist, the compile stuck at a point and prompt that g++ cannot find json/json.h, I check my standard header path(/usr/include) which indeed has this hearder file. after struggle for a while I found This project use header file from its own thirdparty directory(not /usr/include) and the include_directory path was incorrectly set by me!! This upset me How can it be realized since #include <> should firstly search standard header file path(/usr/include) !!??
This documentation
https://en.cppreference.com/w/c/preprocessor/include
Says about including with ""
"Typical implementations first search the directory where the current file resides and, only if the file is not found, search the standard include directories"
I'm not certain I understand your question very well but,
if json/json.h is present in your local directories,
may be should you include this header-file with ""?

c++ Cannot open include file when file location is correct

I have been trying to include Botan files into my project, but so far, it hasn't been working because it can't find the files. I am using Clion IDE with Cmake and in the CmakeLists.txt file, I have included the relative path to the files I want to add:
include_directories(./Botan/include)
From there, I want to add the sha2_64.h file to one of my header files, so I have the following in my header file:
#include <botan/sha2_64.h>
The autofill worked properly in Clion and it found botan/sha2_64.h but when it came time to build the project, I get the error "Cannot open include file: 'botan/sha2_64.h': No such file or directory" Why can the autofill find the file, but the compiler can't? I even tried accessing the file by using:
#include "../Botan/include/botan/sha2_64.h" //Relative path from my header file to sha2_64.h
This still resulted in the file not being found. I know that this path is correct as Clion's autofill finds it no problem. I just can't figure out why the compiler can't find the file.

No such file or directory in Arduino Project

I'm very new in Arduino, so maybe my question will be stupid but I have to ask it!
I made a mqtt client for my nodeMcu chip, and I have this error
/Users/mikevorisis/Downloads/pubsubclient-master/examples/mqtt_esp8266/mqtt_esp8266.ino:27:26:
fatal error: PubSubClient.h: No such file or directory #include
I downloaded the original project from github and I tried to compile the example it has in examples/mqtt_esp8266 but again I have the same problem.
I also tried to put the PubSubClient.h in the same folder but again I have the same problem.
Any ideas?
Thanks in advance.
The file you have downloaded and included in your project is probably not actually a header file. You probably copied the contents of it from github and pasted it into a text document which you saved as a text file with the extension ".h".
It now has the extension "filename.h.txt". The name and extension need to be only "filename.h". Use save as, and select "all files" when saving, and name it "filename.h". Be sure to retype the filename, or it can be auto-filled with the already existing "filename.h.txt" (even if you don's see it!).
If the file now has the right extension, put it in the same folder as your source code file. You can see which directory your source file is in by going to "save as" in your IDE.
A problem you might run into after this is missing definitions. You see, when you use libraries in the form of header files, each header file must usually (in this case, yes) be accompanied by a .cpp file (not necessarily with the same name). The reason for this is that the header file contains declarations, and the cpp file the definitions for said declarations. In other words, the header file is an overview of the facilities available in the library, and the cpp file actually implements the guts of it.
Edit: The example you are trying to run also has #include <ESP8266WiFi.h>, a file that is not available in the github repository that you referred to. I assume that this is a library for a WiFi module or such that you can get elsewhere (manufacturer, other git's or maybe it comes with the Arduino IDE?). In other words, you also need to add its header and (probably) .cpp file to your source directory.

include<apis/api1/api.h> throws No such file or directory

#include<apis/api1/api.h>
throws No such file or directory
i even tried moving api.h and api.cc to the main project directory and using
#include<api.h>
does the same thing even though it is in the exact same directory that the other classes use
i tried adding /apis/api1 to the compiler search path
that just crashes the compiler can someone tell me what to type into the compilers compilation line
#include <api.h>
is the way you include a system header. (That is, the header for a library installed on your system.) It does not search in the directory of the source file or in directories specified in -I command line arguments.
#include "api.h"
is the way you include your own headers. (But it will also search library header locations if it doesn't find the header locally.)

Library file placement in C++

I am trying to use the dynamic bitset provided by boost libraries. Downloaded the file boost_1_55_0.tar.bz2 and extracted it into a folder named boost. In this folder I have put my source code file with the #include directive #include <boost/dynamic_bitset.hpp>, when I compile the source code, the compiler returns "No such file or directory". Where to place the source code?
I managed to compile the program by putting the source code file in the the same directory that boost is in, and compiling using the command formula:
g++ -I /your/source/root /your/source/root/A/code.cpp
As mentioned in the How to make g++ search for header files in a specific directory?