#how to include sdk directory in vs 2022 to build a static library

46 messages · Page 1 of 1 (latest)

silver dune
#

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

bitter fjordBOT
#

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.

tender geyser
#

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

silver dune
#

i tried to make the library in vs code but the configuration was failing "missing ninja" i couldnt instal ninja

tender geyser
#

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

silver dune
#

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

tender geyser
#

what do you mean by "the library" exactly?

silver dune
#

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

tender geyser
#

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)

silver dune
#

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

tender geyser
#

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

silver dune
#

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)

tender geyser
#

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

bitter fjordBOT
#

@silver dune Has your question been resolved? If so, type !solved :)

silver dune
silver dune
tender geyser
#

no

#

you do need the executable

silver dune
#

in the readme they do say to build..

tender geyser
#

either download it from the release above

#

or build it from source

silver dune
#

ok i didnt see the release bigbrain

#

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

tender geyser
#

cl is the microsoft compiler

#

you don't want that if you're trying to build for the pico

silver dune
#

i will try install

Windows (mingw-w64-i686) hosted cross toolchains
AArch32 bare-metal target (arm-none-eabi)`

silver dune
#

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