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

General • Modifying Pico Examples for additional source files

$
0
0
I am trying to understand how to structure a Pi Pico project to use more than one source file. I am using VS Code. I have installed the Pico extension. I am using the hello_uart example, adding some simple functions to add and subtract integers. I have put the function declarations in a header file, my_math.h:

Code:

int add(int a, int b);int subtract(int a, int b);
I have put the function definitions in the file my_math.c

Both files are in the vscode $workspaceFolder

I have added my_math.c to the add_executable command in CMakeLists.txt
When I execute CMake Configure from the command pallet, using the Pico kit, I get errors:

Code:

[proc] The command: arm-none-eabi-gcc -v failed with error: Error: spawn arm-none-eabi-gcc ENOENT[proc] The command: arm-none-eabi-g++ -v failed with error: Error: spawn arm-none-eabi-g++ ENOENT
Does anyone have any resources about how to do this?

Statistics: Posted by picopirate — Thu Dec 26, 2024 9:21 pm



Viewing all articles
Browse latest Browse all 4060

Trending Articles