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

SDK • multiple definition of `adc_init' (??)

$
0
0
Hi,

The full message is this:
[[build] C:/Users/martin/.pico-sdk/toolchain/14_2_Rel1/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld.exe:

CMakeFiles/spectrumsAnalyzerV01.dir/C_/Users/martin/.pico-sdk/sdk/2.2.0/src/rp2_common/hardware_adc/adc.c.obj: in function `hw_set_bits':
[build] C:/Users/martin/.pico-sdk/sdk/2.2.0/src/rp2_common/hardware_base/include/hardware/address_mapped.h:136:
multiple definition of `adc_init';
CMakeFiles/spectrumsAnalyzerV01.dir/spectrumsAnalyzerV01.c.obj:C:/Users/martin/.pico-sdk/sdk/2.2.0/src/rp2_common/hardware_base/include/hardware/address_mapped.h:136:
first defined here
When I run a grep command for all files “below” C:\Users\martin\.pico-sdk\sdk\2.2.0\src\, ‘adc_init’ appears only once (in subdirectories of adc, where it belongs), but not in address_mapped.h.

Includes:

Code:

#include <stdio.h>#include <pico/stdlib.h>#include <hardware/gpio.h>#include <math.h>#include <pico/time.h>#include <hardware/adc.h>#include <hardware/irq.h>#include <hardware/sync.h>
There are 3 additional .c snippets, which are included at the end of all definitions in spectrumsAnalyzerV01.c, using #include.
None of them contain any further #includes.

CMakeList

Code:

add_executable(spectrumsAnalyzerV01 spectrumsAnalyzerV01.c )pico_set_program_name(spectrumsAnalyzerV01 "spectrumsAnalyzerV01")pico_set_program_version(spectrumsAnalyzerV01 "0.1")# Add the standard library to the buildtarget_link_libraries(spectrumsAnalyzerV01         pico_stdlib hardware_adc) #MAHtarget_compile_options(spectrumsAnalyzerV01 PRIVATE -O2)# Add the standard include files to the buildtarget_include_directories(spectrumsAnalyzerV01 PRIVATE        ${CMAKE_CURRENT_LIST_DIR})pico_add_extra_outputs(spectrumsAnalyzerV01)

Any ideas?

Cheers!
Martin

Statistics: Posted by MartinHill — Mon Feb 23, 2026 8:59 pm — Replies 1 — Views 36



Viewing all articles
Browse latest Browse all 7503

Trending Articles