Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake executable issue w/Pico-examples Projects #582

Open
benji7480 opened this issue Nov 25, 2024 · 15 comments
Open

Cmake executable issue w/Pico-examples Projects #582

benji7480 opened this issue Nov 25, 2024 · 15 comments

Comments

@benji7480
Copy link

I was able to compile all the pico-examples Projects 2 months ago. Now i tried doing the same and the experience build errors.
I have copied text of the build Errors when building below:

build errors ---> Build failed: Unable to configure the project Bad CMake executable: "". Check to make sure it is installed or the value of the "cmake.cmakePath" setting contains the correct path

@peterharperuk
Copy link
Contributor

Can you try deleting your build folder and see if it's still a problem?

@benji7480
Copy link
Author

benji7480 commented Nov 25, 2024

Can you try deleting your build folder and see if it's still a problem?

Hi Peter, i am still not so profound/proficient w/the visual studio project folder structure.. tried my best to locate the build folder, but cudn't. can u give me a few simple steps to locate the build folder and then i can delete it.

here is also the additional copy of error on the o/p console : [main] Building folder: pico-examples
[rollbar] Unhandled exception: Unhandled Promise rejection: build Error: Build failed: Unable to configure the project {}

thanks

@benji7480
Copy link
Author

Can you try deleting your build folder and see if it's still a problem?

Hi Peter, located the build folder inside the pico-sdk folder abd deleted it. I gave the build cmd again and the same problem persists. pls guide further w/this issue and how to solve this..

@peterharperuk
Copy link
Contributor

Are you running on Windows or Linux or Mac?

@benji7480
Copy link
Author

Hi Peter, i restored build folder inside the pico-sdk folder and deleted the build folder inside the pico-examples folder now. I gave the build cmd again and the same problem persists.

i am running it on windows 11 home edition

@peterharperuk
Copy link
Contributor

@will-v-pi Have you heard of this error before?

@will-v-pi
Copy link
Contributor

No, but it sounds like the configuration is quite weird, especially if the build folder for pico-examples is inside the pico-sdk folder?

Could you check the value of cmake.cmakePath in your settings (the file is .vscode/settings.json) as suggested by the first error message?

@benji7480
Copy link
Author

No, but it sounds like the configuration is quite weird, especially if the build folder for pico-examples is inside the pico-sdk folder?

Could you check the value of cmake.cmakePath in your settings (the file is .vscode/settings.json) as suggested by the first error message?

Hi Will-V-Pi, do not mis understand my communication chronology as "pico-examples folder is inside the pico-sdk folder". just that being a novice to VS environment i happened to find the SDK build folder 1st and deleted it. then i restored it and then found the pico-examples build folder and deleted it which is what Peter wanted me to do exactly. Will soon post the value of cmake.cmakePath in my .vscode/settings.json file....

@benji7480
Copy link
Author

benji7480 commented Nov 28, 2024

No, but it sounds like the configuration is quite weird, especially if the build folder for pico-examples is inside the pico-sdk folder?

Could you check the value of cmake.cmakePath in your settings (the file is .vscode/settings.json) as suggested by the first error message?

Hi Will-v-Pi, here is my .vscode/settings.json file contents below - i dont see any cmake.cmakePath line though...

`
{
// These settings tweaks to the cmake plugin will ensure
// that you debug using cortex-debug instead of trying to launch
// a Pico binary on the host

"cmake.statusbar.advanced": {
"debug": {
"visibility": "hidden"
},
"launch": {
"visibility": "hidden"
},
"build": {
"visibility": "hidden"
},
"buildTarget": {
"visibility": "hidden"
}
},
"cmake.buildBeforeRun": true,
"cmake.configureOnOpen": true,
"cmake.configureSettings": {
"CMAKE_MODULE_PATH": "${env:PICO_INSTALL_PATH}/pico-sdk-tools"
},
"cmake.generator": "Ninja",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}

`

@will-v-pi
Copy link
Contributor

You may have it configured more globally than that file then - could you see if you've modified it in your settings elsewhere? You can view settings from File -> Preferences -> Settings, then search for cmake.cmakePath.

If it's set to the default cmake then this suggests you don't have CMake installed in your Path - you can check this by running cmake --version from a terminal window.

Also, if you're using the deprecated pico-setup-windows installer (which I think you are given the comment at the top of that settings file), make sure you're using the Pico VS Code, rather than the regular VS Code.

@benji7480
Copy link
Author

You may have it configured more globally than that file then - could you see if you've modified it in your settings elsewhere? You can view settings from File -> Preferences -> Settings, then search for cmake.cmakePath.

If it's set to the default cmake then this suggests you don't have CMake installed in your Path - you can check this by running cmake --version from a terminal window.

Also, if you're using the deprecated pico-setup-windows installer (which I think you are given the comment at the top of that settings file), make sure you're using the Pico VS Code, rather than the regular VS Code.

Hi Will, found that it is set to default 'cmake' and i dont have cmake installed in my path.

How do i now install Pico VS Code?

@will-v-pi
Copy link
Contributor

How do i now install Pico VS Code?

That was for the deprecated pico-setup-windows installer, which would have added an alias called Pico - Visual Studio Code to the taskbar - if that's not installed then I would not recommend installing it now.

Instead of using that deprecated setup, I'd recommend using the new Pico VS Code Extension which is documented in the Getting Started guide PDF. Make sure you uninstall the old setup first (go to "Add or remove programs" and uninstall "Raspberry Pi Pico SDK v1.5.1" is it's there).

@benji7480
Copy link
Author

benji7480 commented Nov 28, 2024

How do i now install Pico VS Code?

That was for the deprecated pico-setup-windows installer, which would have added an alias called Pico - Visual Studio Code to the taskbar - if that's not installed then I would not recommend installing it now.

Instead of using that deprecated setup, I'd recommend using the new Pico VS Code Extension which is documented in the Getting Started guide PDF. Make sure you uninstall the old setup first (go to "Add or remove programs" and uninstall "Raspberry Pi Pico SDK v1.5.1" is it's there).

trying it....

@benji7480
Copy link
Author

How do i now install Pico VS Code?

That was for the deprecated pico-setup-windows installer, which would have added an alias called Pico - Visual Studio Code to the taskbar - if that's not installed then I would not recommend installing it now.

Instead of using that deprecated setup, I'd recommend using the new Pico VS Code Extension which is documented in the Getting Started guide PDF. Make sure you uninstall the old setup first (go to "Add or remove programs" and uninstall "Raspberry Pi Pico SDK v1.5.1" is it's there).

Hi Will, tried all the above steps as u mentioned..now sdk2.1.0 is installed, but,compilation fails as below: btw i am not able to locate a compiler w/sdk 2.1.0 version, u can see that still i can only select the old compiler for the build .i.e....sdk v1.5.1

pasted the failure below: this is when i import/create the blink project via pico vs code extension installed and sdk 2.1.0 gets installed automatically on the 1st time. the new blink project throws the below failure.

CMake Error at C:/Users/vijay/.pico-sdk/cmake/v3.29.9/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):The C compiler

"C:/Program Files/Raspberry Pi/Pico SDK v1.5.1/gcc-arm-none-eabi/bin/arm-none-eabi-gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: 'C:/Users/vijay/Documents/Pico-v1.5.1/pico-examples/blink/build/CMakeFiles/CMakeScratch/TryCompile-zc4ykr'

Run Build Command(s): C:/Users/vijay/.pico-sdk/ninja/v1.12.1/ninja.exe -v cmTC_cbce5
[1/2] C:\PROGRA1\RASPBE1\PICOSD1.1\GCC-AR1\bin\AR19DD1.EXE -o CMakeFiles/cmTC_cbce5.dir/testCCompiler.c.obj -c C:/Users/vijay/Documents/Pico-v1.5.1/pico-examples/blink/build/CMakeFiles/CMakeScratch/TryCompile-zc4ykr/testCCompiler.c
[2/2] C:\Windows\system32\cmd.exe /C "cd . && C:\PROGRA
1\RASPBE1\PICOSD1.1\GCC-AR1\bin\AR19DD1.EXE CMakeFiles/cmTC_cbce5.dir/testCCompiler.c.obj -o cmTC_cbce5.exe -Wl,--out-implib,libcmTC_cbce5.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
FAILED: cmTC_cbce5.exe
C:\Windows\system32\cmd.exe /C "cd . && C:\PROGRA1\RASPBE1\PICOSD1.1\GCC-AR1\bin\AR19DD1.EXE CMakeFiles/cmTC_cbce5.dir/testCCompiler.c.obj -o cmTC_cbce5.exe -Wl,--out-implib,libcmTC_cbce5.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
c:/progra
1/raspbe1/picosd1.1/gcc-ar1/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: unrecognized option '--major-image-version'
c:/progra
1/raspbe1/picosd1.1/gcc-ar~1/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.

@will-v-pi
Copy link
Contributor

Yes, it looks like your system is still trying to use the old pico-setup-windows compiler. Make sure that is completely uninstalled before trying to use the new VS Code extension, including all files, registry entries, and environment variable settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants