gcc.exe: error: unrecognized command-line option '-mthumb'
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- c, cmake
- Domain
- build-system
Research direction
Start at CMakeLists.txt:7 and inspect how the compiler and toolchain are selected during project configuration. Re-run the configure step while checking the compiler shown in the output; done means CMake uses a compiler that accepts the ARM flags and the simple test program configures successfully.
Written by the indexing model from the issue text.
Description
I tried compiling the i2c\lcd_1602_i2c example and got the below error, any idea on how I can get around this?
C:\Users-\Documents\pico\pico-examples\build\i2c\lcd_1602_i2c>mingw32-make
PICO_SDK_PATH is C:/Users/-/Downloads/pico-sdk-master (1)/pico-sdk
Target board (PICO_BOARD) is 'pico'.
Using board configuration from C:/Users/-/Downloads/pico-sdk-master (1)/pico-sdk/src/boards/include/boards/pico.h
Pico Platform (PICO_PLATFORM) is 'rp2040'.
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/VSARM/mingw/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/VSARM/mingw/mingw64/bin/gcc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler
"C:/VSARM/mingw/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
Run Build Command(s): "C:/Program Files/CMake/bin/cmake.exe" -E env VERBOSE=1 C:/VSARM/mingw/mingw64/bin/mingw32-make.exe -f Makefile cmTC_34270/fast
mingw32-make[1]: Entering directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
C:/VSARM/mingw/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_34270.dir\build.make CMakeFiles/cmTC_34270.dir/build
mingw32-make[2]: Entering directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
Building C object CMakeFiles/cmTC_34270.dir/testCCompiler.c.obj
C:\VSARM\mingw\mingw64\bin\gcc.exe -mcpu=cortex-m0plus -mthumb -o CMakeFiles\cmTC_34270.dir\testCCompiler.c.obj -c C:\Users\-\Documents\pico\pico-examples\build\CMakeFiles\CMakeScratch\TryCompile-cjdk0h\testCCompiler.c
gcc.exe: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc.exe: error: unrecognized command-line option '-mthumb'
mingw32-make[2]: *** [CMakeFiles\cmTC_34270.dir\build.make:80: CMakeFiles/cmTC_34270.dir/testCCompiler.c.obj] Error 1
mingw32-make[2]: Leaving directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
mingw32-make[1]: *** [Makefile:132: cmTC_34270/fast] Error 2
mingw32-make[1]: Leaving directory 'C:/Users/-/Documents/pico/pico-examples/build/CMakeFiles/CMakeScratch/TryCompile-cjdk0h'
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:7 (project)
-- Configuring incomplete, errors occurred!
mingw32-make: *** [Makefile:1520: cmake_check_build_system] Error 1
- Dominant language
- C
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raspberrypi/pico-examples
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
raspberrypi/pico-examples#788 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
raspberrypi/pico-examples#780 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
raspberrypi/pico-examples#262 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
raspberrypi/pico-examples#224 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
raspberrypi/pico-examples#783 ·
All issues in raspberrypi/pico-examples
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100