Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

SDK • Re: Include path not working for all files

$
0
0
Maybe try using #include <pico/stdlib.h> for include files found in include paths.
or maybe even #include <stdlib.h>
#include "something.h" is usually used for .h files found somewhere locally to the .c/.cpp file that includes them.
This is a common mistake:

Code:

#include <stdlib.h>// Correct (Standard C/C++ header)#include "stdlib.h"// Incorrect (Standard C/C++ header)#include <pico/stdlib.h>// Incorrect (SDK/User header)#include "pico/stdlib.h"// Correct (SDK/User header)
ePaperDisplay
.....|
.....|--ePaperDisplay.c
.....|--CMakeLists.txt
.....|--lib
..........|
..........|--Config
...............|
...............|--DEV_Config.h
...............|--DEV_Config.c
...............|--CMakeLists.txt
This is not good structure. Try this instead:

Code:

ePaperDisplay.....|--include..........|--Config...............|--DEV_Config.h.....|--src..........|--ePaperDisplay.c..........|--CMakeLists.txt.....|--CMakeLists.txt.....|--lib..........|--Config...............|--DEV_Config.c...............|--CMakeLists.txt..........|--CMakeLists.txt

Let's get a look at your CMake files.

Statistics: Posted by dthacher — Sat Nov 09, 2024 10:54 am



Viewing all articles
Browse latest Browse all 4151

Trending Articles