Renee Ofadu
Renee Ofadu

Reputation: 11

CMake Error When Trying to Configure File for Pi Pico

I am using VSCode for Pi Pico and followed this tutorial https://www.youtube.com/watch?v=mUF9xjDtFfY&ab_channel=LearnEmbeddedSystems. Everything was working fine yesterday and today when I went to configure my files and further build them I am met with this in my output window in vscode:


[variant] Loaded new set of variants
[kit] Successfully loaded 1 kits from C:\Users\faith\AppData\Local\CMakeTools\cmake-tools-kits.json
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --version
[proc] Executing command: "C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.07\bin\arm-none-eabi-gcc.exe" -v
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" "-SC:/Users/faith/CSU23021 Microprocessor Systems/pico-apps/assignments/assign01" "-Bc:/Users/faith/CSU23021 Microprocessor Systems/build" -G "NMake Makefiles"
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" "-SC:/Users/faith/CSU23021 Microprocessor Systems/pico-apps/assignments/assign01" "-Bc:/Users/faith/CSU23021 Microprocessor Systems/build" -G "NMake Makefiles" exited with code: 1
[main] Configuring project: CSU23021 Microprocessor Systems 
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_C_COMPILER:FILEPATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.07\bin\arm-none-eabi-gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.07\bin\arm-none-eabi-g++.exe" "-SC:/Users/faith/CSU23021 Microprocessor Systems/pico-apps/assignments/assign01" "-Bc:/Users/faith/CSU23021 Microprocessor Systems/build" -G "NMake Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Warning (dev) in CMakeLists.txt:
[cmake]   No project() command is present.  The top-level CMakeLists.txt file must
[cmake]   contain a literal, direct call to the project() command.  Add a line of
[cmake]   code such as
[cmake] 
[cmake]     project(ProjectName)
[cmake] 
[cmake]   near the top of the file, but after cmake_minimum_required().
[cmake] 
[cmake]   CMake is pretending there is a "project(Project)" command on the first
[cmake]   line.
[cmake] This warning is for project developers.  Use -Wno-dev to suppress it.
[cmake] 
[main] Configuring project: CSU23021 Microprocessor Systems 
[cmake] -- The C compiler identification is GNU 10.3.1
[cmake] -- The CXX compiler identification is GNU 10.3.1
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - failed
[cmake] -- Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.07/bin/arm-none-eabi-gcc.exe
[cmake] -- Check for working C compiler: C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.07/bin/arm-none-eabi-gcc.exe - broken
[cmake] CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
[cmake]   The C compiler
[cmake] 
[cmake]     "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.07/bin/arm-none-eabi-gcc.exe"
[cmake] 
[cmake]   is not able to compile a simple test program.
[cmake] 
[cmake]   It fails with the following output:
[cmake] 
[cmake]     Change Dir: C:/Users/faith/CSU23021 Microprocessor Systems/build/CMakeFiles/CMakeScratch/TryCompile-6dlzjh
[cmake]     
[cmake]     Run Build Command(s):nmake -f Makefile /nologo cmTC_c113f\fast &&   "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x86\nmake.exe"  -f CMakeFiles\cmTC_c113f.dir\build.make /nologo -L                  CMakeFiles\cmTC_c113f.dir\build
[cmake]     Building C object CMakeFiles/cmTC_c113f.dir/testCCompiler.c.obj
[cmake]         C:\PROGRA~2\GNUARM~1\102021~1.07\bin\AR19DD~1.EXE    -o CMakeFiles\cmTC_c113f.dir\testCCompiler.c.obj -c "C:\Users\faith\CSU23021 Microprocessor Systems\build\CMakeFiles\CMakeScratch\TryCompile-6dlzjh\testCCompiler.c"
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/faith/CSU23021 Microprocessor Systems/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/Users/faith/CSU23021 Microprocessor Systems/build/CMakeFiles/CMakeError.log".
[cmake]     Linking C executable cmTC_c113f.exe
[cmake]         "C:\Program Files\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_c113f.dir/objects.a
[cmake]         C:\PROGRA~2\GNUARM~1\102021~1.07\bin\ARM-NO~2.EXE qc CMakeFiles\cmTC_c113f.dir/objects.a @CMakeFiles\cmTC_c113f.dir\objects1
[cmake]         C:\PROGRA~2\GNUARM~1\102021~1.07\bin\AR19DD~1.EXE -Wl,--whole-archive CMakeFiles\cmTC_c113f.dir/objects.a -Wl,--no-whole-archive -o cmTC_c113f.exe -Wl,--out-implib,libcmTC_c113f.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\cmTC_c113f.dir\linkLibs.rsp
[cmake]     c:/progra~2/gnuarm~1/102021~1.07/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: unrecognized option '--major-image-version'
[cmake]     c:/progra~2/gnuarm~1/102021~1.07/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: use the --help option for usage information
[cmake]     collect2.exe: error: ld returned 1 exit status
[cmake]     NMAKE : fatal error U1077: 'C:\PROGRA~2\GNUARM~1\102021~1.07\bin\AR19DD~1.EXE' : return code '0x1'
[cmake]     Stop.
[cmake]     NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x86\nmake.exe"' : return code '0x2'
[cmake]     Stop.
[cmake]     
[cmake]     
[cmake] 
[cmake]   
[cmake] 
[cmake]   CMake will not be able to correctly generate this project.
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt
[cmake] 
[cmake] 
[cmake] CMake Warning (dev) in CMakeLists.txt:
[cmake]   No cmake_minimum_required command is present.  A line of code such as
[cmake] [{
    "resource": "/C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake",
    "owner": "cmake-configure-diags",
    "severity": 8,
    "message": "CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):The C compiler\n\n  \"C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.07/bin/arm-none-eabi-gcc.exe\"\n\nis not able to compile a simple test program.\n\nIt fails with the following output:\n\n  Change Dir: C:/Users/faith/CSU23021 Microprocessor Systems/build/CMakeFiles/CMakeScratch/TryCompile-6dlzjh\n  \n  Run Build Command(s):nmake -f Makefile /nologo cmTC_c113f\\fast && \t\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x86\\nmake.exe\"  -f CMakeFiles\\cmTC_c113f.dir\\build.make /nologo -L                  CMakeFiles\\cmTC_c113f.dir\\build\n  Building C object CMakeFiles/cmTC_c113f.dir/testCCompiler.c.obj\n  \tC:\\PROGRA~2\\GNUARM~1\\102021~1.07\\bin\\AR19DD~1.EXE    -o CMakeFiles\\cmTC_c113f.dir\\testCCompiler.c.obj -c \"C:\\Users\\faith\\CSU23021 Microprocessor Systems\\build\\CMakeFiles\\CMakeScratch\\TryCompile-6dlzjh\\testCCompiler.c\"\n-- Configuring incomplete, errors occurred!\nSee also \"C:/Users/faith/CSU23021 Microprocessor Systems/build/CMakeFiles/CMakeOutput.log\".\nSee also \"C:/Users/faith/CSU23021 Microprocessor Systems/build/CMakeFiles/CMakeError.log\".\n  Linking C executable cmTC_c113f.exe\n  \t\"C:\\Program Files\\CMake\\bin\\cmake.exe\" -E rm -f CMakeFiles\\cmTC_c113f.dir/objects.a\n  \tC:\\PROGRA~2\\GNUARM~1\\102021~1.07\\bin\\ARM-NO~2.EXE qc CMakeFiles\\cmTC_c113f.dir/objects.a @CMakeFiles\\cmTC_c113f.dir\\objects1\n  \tC:\\PROGRA~2\\GNUARM~1\\102021~1.07\\bin\\AR19DD~1.EXE -Wl,--whole-archive CMakeFiles\\cmTC_c113f.dir/objects.a -Wl,--no-whole-archive -o cmTC_c113f.exe -Wl,--out-implib,libcmTC_c113f.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\\cmTC_c113f.dir\\linkLibs.rsp\n  c:/progra~2/gnuarm~1/102021~1.07/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: unrecognized option '--major-image-version'\n  c:/progra~2/gnuarm~1/102021~1.07/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: use the --help option for usage information\n  collect2.exe: error: ld returned 1 exit status\n  NMAKE : fatal error U1077: 'C:\\PROGRA~2\\GNUARM~1\\102021~1.07\\bin\\AR19DD~1.EXE' : return code '0x1'\n  Stop.\n  NMAKE : fatal error U1077: '\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x86\\nmake.exe\"' : return code '0x2'\n  Stop.\n  \n  \n\n\n\nCMake will not be able to correctly generate this project.",
    "source": "CMake (message)",
    "startLineNumber": 70,
    "startColumn": 1,
    "endLineNumber": 70,
    "endColumn": 10000
}]

This is in my problems window on vscode:

[cmake]     cmake_minimum_required(VERSION 3.25)
[cmake] 
[cmake]   should be added at the top of the file.  The version specified may be lower
[cmake]   if you wish to support older CMake versions for this project.  For more
[cmake]   information run "cmake --help-policy CMP0000".
[cmake] This warning is for project developers.  Use -Wno-dev to suppress it.
[cmake] 
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_C_COMPILER:FILEPATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.07\bin\arm-none-eabi-gcc.exe" "-DCMAKE_CXX_COMPILER:FILEPATH=C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.07\bin\arm-none-eabi-g++.exe" "-SC:/Users/faith/CSU23021 Microprocessor Systems/pico-apps/assignments/assign01" "-Bc:/Users/faith/CSU23021 Microprocessor Systems/build" -G "NMake Makefiles" exited with code: 1

I am new to using Pi Pico and I am just learning it in a college module. Please let me know if you need more info :)

I tried to uninstall CMake and install it again following the tutorial but this did not work

Upvotes: 0

Views: 789

Answers (0)

Related Questions