if i add manually the directories where the initial missing headers i get new missing headers from those headers, i already tried to add the whole sdk recursively but i dont know how so i made a .bat file to fetch all include folders in the sdk directory and even so with 8k characters worth of include paths i still have 3 missing headers, i cant find those on the sdk but anyway this doesnt seem the right way
I am trying to include the pico sdk btw
#how to include sdk directory in vs 2022 to build a static library
46 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
are you using a VS solution or cmake?
the pico sdk is for the raspberry pi pico, right?
I'm pretty sure you can't use Microsoft's compiler to build for that
There is a VS Code extensions that says it makes it easy: https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico
even library?
i tried to make the library in vs code but the configuration was failing "missing ninja" i couldnt instal ninja
if the library is just portable code, sure, I guess
but it's called the pico sdk, I don't imagine much of the code in it would work on windows
i didnt try using the extention for the library though, i am using the extention for the main projects though, maybe i should try that if its supported
what do you mean by "the library" exactly?
hmm i dont want it to work on windows i want to reference a library on a pico project , its "sharable" code to simplify my pico projects
but i was trying to make it as a static library
i am new to c++ but in c# this should be quite easy
although at this point i have the files and i can copy paste to each project , i just wanted to learn how to make a library, in this case static seemed better
how did you try to create the library
but yes VS compiles for windows only, whether it's a library or not
(unless possibly if you are using cmake as a build system and a different compiler)
this started a long time ago (in the morning) i tried creating a fresh project in vs code and compile it into static library but it was missing ninja, i tried several ways that i will not enumerate, eventually someone recommended using vs 2022 so i created a new project with static library .lib template (i assumed its to use on windows but not necessarily to execute since its a library not a program) i modify this project by both adding my files, addind the include directories and i removed the default files that we something to precompile includes and something else that i didnt think i need meant to reduce dependencies
so if the end program is not for windows i cant build as "regular" library?
is there a way i can make a library to use in a project with the pico sdk?
i should see if the pico extention has a library option, i didnt thought about that
I have no idea how the pico extension works,
but yes in principle you can make libraries for whatever target system you want
but you have to use the compiler/toolchain for that target
since C++ compiles to native code, the library only works for the target platform
okok thanks i am not currently at that, but it was already helpful to understand that
i will try the extension or if no library optionis available i can try to target the toolchain included
i supose ninja should do that somehow but i couldnt install it, i clone the repo, but i couldnt build, not with cmake, not with python (they have a .py script)
ninja probably means you are using cmake
installing ninja on windows is pretty easy
just download it, put it somewhere, edit your PATH to include that folder
@silver dune Has your question been resolved? If so, type !solved :)
i was using in vs code yes
folder? i was looking for a binary or something, i just have to link the PATH to the..\ninja directory?
in the readme they do say to build..
ok i didnt see the release 
tried to build but couldnt for some reason, that was saying i dont have cl and to try in developer command prompt for vs but even there i couldnt
i can try that as well
cl is the microsoft compiler
you don't want that if you're trying to build for the pico
i will try install
Windows (mingw-w64-i686) hosted cross toolchains
AArch32 bare-metal target (arm-none-eabi)`
btw i couldnt do it. i ended up just adopting the copy paste method..
i installed this toolchain mentioned above but i got the same errors i got previously in visual studio, "missing header files" there is a file that might solve this issue i just couldnt make it work but this file is something like "pico_import.cmake" i did try to include it but it didnt work. i have to see how to use this files