PlatformIO cant find included libraries - include

I am running into a strange issue with including libraries in the lib folder.
Project details:
ESP32 with Arduino Framework
Trying to get the Adafruit HX8357D LCD to work
What I have done:
Please see the picture attached. I have included all the libraries that I should need. When I compile I run into the "No such file or directory error. I have clearly included the "Adafruit_I2CDevice.h" file in the lib folder under its master folder. But the compiler does not see it. Why?
If I move all the .h and .cpp files in the Adafruit_BusIO-master folder to Adafruit_GFC-Librari-master folder then the "fatal error: Adafruit_I2CDevice.h no such..." error just changes to a different file that is located in the lib folder.
This means there is a deeper issue here with the linker.
Does anyone know why it is doing this? I have not in the past had issues with including files located in the lib folder into various other sources.
Any help would be great.
Thank you

I use TFT_eSPI by Bodmer for Adafruit HX8357D. I use the following command to install the lib in my project and it does all th taff.
pio lib install "bodmer/TFT_eSPI#^2.3.64"
In your case have a look to c_cpp_properties.json in .vscode of your projet to be sure that the "includePath" and "path" points to the good include directories.

From the home screen of PlatformIO, you will have to go to the libraries section and search for your desired libraries there, assigning libraries to your desired libraries from there. Only then it will work properly.
If your libraries are successfully added, they should be inside the .pio\libdeps of your project directory.

Related

Integrating React-Native and TesseractOCR

I am attempting to integrate the TesseractOCRiOS package as part of the implementation of the react-native-text-detector package (https://github.com/zsajjad/react-native-text-detector). However, I am unable to compile under iOS, it fails with a 'TesseractOCR/TesseractOCR.h' file not found error.
I can see TesseractOCR in my Pods directory in Xcode but it does not follow the normal packaging convention. By this I mean, normally, I see a *.framework package within the directory but not in this case. I see the TesseractOCRiOS/TesseractOCR directory and within there, the *.h header files, *.m implementation files and lib/include directories.
I tried attempting to reference the header files through the Build Settings/Header Search Paths but that did not work. Thoughts on what you need to do in XCode to find the necessary header files?

Using SDL-C library with Code::Blocks on Windows...wizard can't locate SDLmain library file

I am new to programming and I am trying to use SDL library with Code::Blocks on Windows. I downloaded the Library from : https://www.libsdl.org/download-2.0.php.
I downloaded the files, decompressed and then copied SDL.dll file in
C:\Program Files (x86)\CodeBlocks\MinGW\bin
and then the include and lib files in
C:\Program Files (x86)\CodeBlocks\SDL,
which is a new file I created. However, when I open Code::Blocks, new SDL project and arrive at the step where I am supposed to give the directory where the include and lib files are, once I hit next I get the following error :
The path you entered seems valid but the wizard can't locate the following SDL's library file: SDLmain in it.
Any idea why this might be happening and how I can fix it?

cmake-gui show blank except source code directory and binaries directory

After installing cmake-3.8.1-win64-x64 I got thisenter image description here
So what can I do with this? Thanks.
cmake-gui does not help you create cmake configuration files, it parses these files to generate and configure projects.
In your source code directory, you should have a CMakeLists.txt file which defines the rules for CMAKE to configure your problem. That directory should be entered into the first box.
Next, you get to decide where to build the binaries. We could do it in the source directory, but the generated artifacts could pollute what is already there. "Cleaning" the build by deleting all of those artifacts while keeping the original sources is tedious at best, so it's a good idea to make an empty directory and use that as your binaries path.
Once you have those fields entered, you should be able to "Generate" or "Configure" your project. If you need help creating a CMakeLists.txt file (that's really the complicated part), then check out their tutorial.

Visual studio and dlib: "cannot open include file: 'zlib.h': No such file or directory"

For my thesis I want to use Dlib's face_landmark_detection, but I keep running into these errors (for both Visual studio 2013 as well as 2015):
"cannot open include file: 'zlib.h': No such file or directory"
and
"'F77_INT': undeclared identifier".
It repeats itself so I have 36 errors based on these two problems.
My supervisor has given me some steps to follow to set up the project:
add dlib-master and dlib-master\examples to VC++ directories -> include directories
add dlib-master\dlib\external\libjpeg and dlib-master\dlib\entropy_decoder to C/C++ -> General -> Additional include directories
add all folders and items from dlib-master\dlib\external (cblas, libjpeg, libpng and zlib) to the project source folder
add the dlib source file (from dlib-master\dlib\all) and add face_landmark_detection (from dlib-master\examples) to the project source folder.
and according to him this has worked on every other computer so far, but on my laptop it just won't. We checked to project, but zlib.h is in the zlib folder in the project. Does anyone here have an idea on what might be going wrong?
If I didn't give enough info, please ask. I don't know what else might be needed to solve this.
I have just come about this same problem and wanted to post my solution since I have found so much conflicting documentation on the subject.
The folder containing the dlib folder as well as the libpng, libjpeg, and zlib folders from dlib/external need to be added to the additional include directories list in the solution settings.
dlib/all/source.cpp as well as the source files for libpng, libjpeg, and zlib also need to be added to the project.
Note that CBLAS should not be added to the project in any way, because it needs Fortran to compile, and it is very difficult to get this to compile from Visual Studio.
Finally, make sure to add DLIB_PNG_SUPPORT and DLIB_JPEG_SUPPORT as preprocessor defines in the project settings.
I also attempted to use a cmake generated solution, however, for some reason it had trouble with png support.
It is probably easiest to use CMake to configure your project which uses dlib. It avoids setting all those paths manually. During CMake configure step you can disable usage of libraries like zlib which you don't have/want/need. Here is an example CMakeLists.txt which works for me:
cmake_minimum_required(VERSION 2.6)
PROJECT(DatasetClassifier CXX C)
set(dlib_DIR "" CACHE PATH "Path to dlib") # http://dlib.net/
include(${dlib_DIR}/dlib/cmake)
ADD_EXECUTABLE(DatasetClassifier DatasetClassifier.cpp)
TARGET_LINK_LIBRARIES(DatasetClassifier ${dlib_LIBRARIES})

OpenCV debugging/step into issue

I have the following issue in OpenCV: I have built the openCV libraries with CMake and compiled the OpenCV solution and the corresponding .pdb files were generated. I have a project that uses OpenCV library and I want to step into a function(cvStereoRectify) that crashes. I have included the symbols in my project (the folder were .pdb files are located) and when it hits the breakpoint at that function and I hit "Step Into" the error is generated and it doesn't go into the OpenCV source function. At runtime, the Modules window shows that opencv_calib3d.dll (and others opencv_*.dll) says that "Cannot find or open the PDB file".
Can someone show me the right way to do this ??
Thanks in advance,
Tamash
In order to step into openCV code you have to copy the pdb and the dll files to the location of your project.
in order to do so , go to your project properties , on the post build step type the lines:
copy "C:\OpenCV2.31\CMake_Build\bin\Debug\*.dll"
copy "C:\OpenCV2.31\CMake_Build\bin\Debug\*.pdb"
If that doesn't work , you'll have to include the *h and *cpp directories of the openCV library on your project setting:
On additional include directories type :
C:\OpenCV2.3\infustracture\Dienet;C:\OpenCV2.31\opencv\build\include;C:\OpenCV2.31\opencv\build\include\opencv;C:\OpenCV2.31\opencv\build\include\opencv2;%(AdditionalIncludeDirectories)
Good luck

Resources