Roel gave me the idea of using vcpkg to install all the dependencies i need to clear up some include file problems in Visual Studio Code in Windows 11.
I am using the instructions to make a helloworld app just to see how it should work .. but the instruction so not work ..
it says to setup 2 files for CMake:
{
"version": 2,
"configurePresets": [
{
"name": "default",
"inherits": "vcpkg",
"environment": {
"VCPKG_ROOT": "<path to vcpkg>"
}
}
]
}
see how it says to define a CMake variable with the <path to vcpkg> .. Step #1 was to create an environment variable VCPKG_ROOT .. in Windows there is an app in Windows 11 Settings to manage env vars so i used it to define VCPKG_ROOT as c:\bin\vcpkg .. that is where i cloned it to
the env var is defined .. when i do echo $env:VCPKG_ROOT I do get c:\bin\vcpkg so that is good
so i change the line defining VCPKG_ROOT to "VCPKG_ROOT": "$ENV{VCPKG_ROOT}"
and the docs and a few forum posts assure me that the is how one makes a CMake variable from a system env var .. ball good … but, the rest of step 4 is to make this file .. CMakePresets.json :
"version": 2,
"configurePresets": [
{
"name": "vcpkg",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
]
see how the definition for CMAKE_TOOLCHAIN_FILE should use the same env var?
but when i run the command cmake --preset=default
CMake Error at C:/Program Files/CMake/share/cmake-4.1/Modules/CMakeDetermineSystem.cmake:159 (message):
Could not find toolchain file:
"$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
I have tried a number of ways to have CMake expand $VCPKG_ROOT but nothing works
i gave up and hard coded the path as “c:/bin/vcpkg/scripts … etc “
then it worked .. the setup at least .. now for cmake —build build
and the result is
cmake --build build
[2/2] Linking CXX executable HelloWorld.exe
FAILED: HelloWorld.exe
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Users\Jeff\AppData\Local\Microsoft\WinGet\Packages\BrechtSanders.WinLibs.MCF.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe\mingw64\bin\c++.exe CMakeFiles/HelloWorld.dir/helloworld.cpp.obj -o HelloWorld.exe -Wl,--out-implib,libHelloWorld.dll.a -Wl,--major-image-version,0,--minor-image-version,0 vcpkg_installed/x64-windows/debug/lib/fmtd.lib -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && C:\WINDOWS\system32\cmd.exe /C "cd /D C:\Users\Jeff\dev\helloworld\build && "C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy Bypass -file C:/bin/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary C:/Users/Jeff/dev/helloworld/build/HelloWorld.exe -installedDir C:/Users/Jeff/dev/helloworld/build/vcpkg_installed/x64-windows/bin -OutVariable out""
C:/Users/Jeff/AppData/Local/Microsoft/WinGet/Packages/BrechtSanders.WinLibs.MCF.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/HelloWorld.dir/helloworld.cpp.obj:helloworld.cpp:(.text+0x7c): undefined reference to `__imp__ZN3fmt3v126vprintENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_7contextEEE'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
which is disappointing
i am using the MINGW clang so that could be the problem .. as it is Windows i dont have env vars set up to give the location of the compilers .. maybe vcpkg is trying to use the wrong one?
anyway .. the immediate curiosity is - why does CMake handle the env var correctly in the one file and not in the other?
anyway .. the immediate curiosity is - why does CMake handle the env var correctly in the one file and not in the other?
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
I would guess it’s because you used lowercase “$env” in your second file. This symbol is case sensitive in CMake; it needs to be $ENV
I cannot really comment on the rest, but if you want to combine vcpkg and mingw I would keep my tongue very very straight and make sure you understand all the nuances in how these may work together.
-Marius
Marius Kintel wrote:
I would guess it’s because you used lowercase “$env” in your second file. This symbol is case sensitive in CMake; it needs to be $ENV
yeah .. i found that error .. i changed the reference to "c:/bin/vcpkg/scripts/buildsystems/vcpkg.cmake" so that it would work .. well, cmake was able to do its thing .. right up until the loader could not resolve a string .. the feedback is a mess of obfuscated variable name so that is a dead end
I cannot really comment on the rest, but if you want to combine vcpkg and mingw I
not really a nuance kinda guy LOL
i am now uninstalling the MingW stuff .. going to see the Windows build instructions make my life better
To be clear, my suggestion was to use vcpkg in classic mode. You now seem
to be using it in manifest mode, which integrates with the build and the
build system. Now I'm not one to tell people how to spend their time, but I
would tell anyone asking that going into that without a deep understanding
of both the toolchain you're targeting, cmake, and the way at least a
sizeable part of the packages you're trying to use, that that hypothetical
person asking is setting themselves up for failure. CMake cannot (in my
experience) be learned to the degree necessary for this by just diving into
an existing, complex build system, certainly not in tandem with
other complex systems you don't understand - you need to build a few of
your own to really understand the various mechanisms at play. (become a
'regular user' of CMake, just adding files, adding a simple library here or
there, setting a compiler flag, ... is possible without that of course,
just like one can become a git 'user' without understanding DAGs and
rebasing).
Anyway, in vcpkg classic mode, you just do 'vcpkg install <package>'
regardless of what you'll be using the library for; meaning, vcpkg doesn't
even know about your target project (OpenSCAD in your case) and it has
nothing to do with CMake. It will just download a package, apply necessary
patches to build on Windows, build it with whatever compiler it finds, and
leave headers and dlls/libs in one directory. In the case of my suggestion,
after that, you just ignore those last two. Download Visual Studio so that
vcpkg can use its compiler, that's all. Completely separate from OpenSCAD.
You then configure VS Code to use the header download path and you're good
to do what it was you initially asked about, which is getting rid of the
red squiggly lines in VS Code without disabling showing red squiggly lines.
This is then completely separate from actually building, linking and
running OpenSCAD.
cheers
On Mon, Sep 29, 2025 at 1:26 AM vulcan_--- via Discuss <
discuss@lists.openscad.org> wrote:
Roel gave me the idea of using vcpkg to install all the dependencies i
need to clear up some include file problems in Visual Studio Code in
Windows 11.
I am using the instructions to make a helloworld app just to see how it
should work .. but the instruction so not work ..
it says to setup 2 files for CMake:
1.
CMakeUserPresets.json with this code (Step #4)
{
"version": 2,
"configurePresets": [
{
"name": "default",
"inherits": "vcpkg",
"environment": {
"VCPKG_ROOT": "<path to vcpkg>"
}
}
]
}
see how it says to define a CMake variable with the <path to vcpkg> ..
Step #1 was to create an environment variable VCPKG_ROOT .. in Windows
there is an app in Windows 11 Settings to manage env vars so i used it to
define VCPKG_ROOT as c:\bin\vcpkg .. that is where i cloned it to
the env var is defined .. when i do echo $env:VCPKG_ROOT I do get
c:\bin\vcpkg so that is good
so i change the line defining VCPKG_ROOT to "VCPKG_ROOT":
"$ENV{VCPKG_ROOT}"
and the docs and a few forum posts assure me that the is how one makes a
CMake variable from a system env var .. ball good … but, the rest of step 4
is to make this file .. CMakePresets.json :
"version": 2,
"configurePresets": [
{
"name": "vcpkg",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
]
see how the definition for CMAKE_TOOLCHAIN_FILE should use the same env
var?
but when i run the command cmake --preset=default
CMake Error at C:/Program
Files/CMake/share/cmake-4.1/Modules/CMakeDetermineSystem.cmake:159
(message):
Could not find toolchain file:
"$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
I have tried a number of ways to have CMake expand $VCPKG_ROOT but nothing
works
i gave up and hard coded the path as “c:/bin/vcpkg/scripts … etc “
then it worked .. the setup at least .. now for cmake —build build
and the result is
cmake --build build
[2/2] Linking CXX executable HelloWorld.exe
FAILED: HelloWorld.exe
C:\WINDOWS\system32\cmd.exe /C "cd . &&
C:\Users\Jeff\AppData\Local\Microsoft\WinGet\Packages\BrechtSanders.WinLibs.MCF.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe\mingw64\bin\c++.exe
CMakeFiles/HelloWorld.dir/helloworld.cpp.obj -o HelloWorld.exe
-Wl,--out-implib,libHelloWorld.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
vcpkg_installed/x64-windows/debug/lib/fmtd.lib -lkernel32 -luser32 -lgdi32
-lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 &&
C:\WINDOWS\system32\cmd.exe /C "cd /D C:\Users\Jeff\dev\helloworld\build &&
"C:\Program Files\PowerShell\7\pwsh.exe" -noprofile -executionpolicy Bypass
-file C:/bin/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary
C:/Users/Jeff/dev/helloworld/build/HelloWorld.exe -installedDir
C:/Users/Jeff/dev/helloworld/build/vcpkg_installed/x64-windows/bin
-OutVariable out""
C:/Users/Jeff/AppData/Local/Microsoft/WinGet/Packages/BrechtSanders.WinLibs.MCF.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
CMakeFiles/HelloWorld.dir/helloworld.cpp.obj:helloworld.cpp:(.text+0x7c):
undefined reference to
`__imp__ZN3fmt3v126vprintENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_7contextEEE'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
which is disappointing
i am using the MINGW clang so that could be the problem .. as it is
Windows i dont have env vars set up to give the location of the compilers
.. maybe vcpkg is trying to use the wrong one?
anyway .. the immediate curiosity is - why does CMake handle the env var
correctly in the one file and not in the other?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Roel Vanhout wrote:
To be clear, my suggestion was to use vcpkg in classic mode. You now seem
to be using it in manifest mode, which integrates with the build and the
build system.
@Roel - I started out automating builds in CP/M batch files and have used pretty much all of the significant build tools since then so even the dreadfully complex vcpkg is not beyond me .. i have had jobs where i HAD TO dive into a complex system, reverse engineer it and make it work and in doing so have had successes .. plural.
I ignored the bulk of your previous patronizing message and went looking for tutorials on vcpkg .. i found an extremely simple, step by step instruction Hello World example for vcpkg to see how it worked .. so Roel .. this is me learning yet another build system starting with the basics.
But this simple example fails .. my question about why vcpkg can access an environment variable in one file but not the other still stands and your love winded put down has been no help whatsoever
ah .. but, that is not completely correct .. it does clarify for me that some of the people in the OpenSCAD community really dislike newcomers just because they are .. new, so asking for help in this forum is counter-productive
I will stick to my tried and true method of just trying shit out until i understand how it works
Well apologies if it came across as patronizing, that wasn't my intention.
Cheers
On Thu, Oct 2, 2025, 01:34 vulcan_--- via Discuss <
discuss@lists.openscad.org> wrote:
Roel Vanhout wrote:
To be clear, my suggestion was to use vcpkg in classic mode. You now seem
to be using it in manifest mode, which integrates with the build and the
build system.
@Roel - I started out automating builds in CP/M batch files and have used
pretty much all of the significant build tools since then so even the
dreadfully complex vcpkg is not beyond me .. i have had jobs where i HAD TO
dive into a complex system, reverse engineer it and make it work and in
doing so have had successes .. plural.
I ignored the bulk of your previous patronizing message and went looking
for tutorials on vcpkg .. i found an extremely simple, step by step
instruction Hello World example for vcpkg to see how it worked .. so Roel
.. this is me learning yet another build system starting with the basics.
But this simple example fails .. my question about why vcpkg can access an
environment variable in one file but not the other still stands and your
love winded put down has been no help whatsoever
ah .. but, that is not completely correct .. it does clarify for me that
some of the people in the OpenSCAD community really dislike newcomers just
because they are .. new, so asking for help in this forum is
counter-productive
I will stick to my tried and true method of just trying shit out until i
understand how it works
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On 9/28/25 4:25 PM, vulcan_--- via Discuss wrote:
Roel gave me the idea of using vcpkg to install all the dependencies i
need to clear up some include file problems in Visual Studio Code in
Windows 11.
I am using the instructions to make a helloworld app just to see how
it should work .. but the instruction so not work ..
I've noticed you have lots of questions about random details. I'm not
shilling, but I have found LLMs to be very useful at answering these
questions. I have been leaning on google's for help with C++ syntax
because I know a set of words describing a concept, but it's not easy to
use a normal web search for things with symbols and the LLM gets the
right answer despite using symbols or using synonyms. It's also good at
posting a code snippet and an error message and getting the answer fast.
Don't ask it how to convert from the parser C %union to C++ variant,
it'll just hallucinate an easy answer.
It's also a free list and feel free to continue to post here. Your email
client isn't setting reply headers correctly though, I'd appreciate if
you fixed it, but it's not a big deal.
-Cory
I'm not a particular LLM fan, but I had a positive experience just last
evening. I'm working on a program to make stone wall patterns, and I'd
decided I wanted to code my own heightmap->mesh algo that emulates
OpenSCAD's. I inspected the OpenSCAD code, left a little wanting for
not grokking the surrounding context. So, I posed a question to Google
along the lines "c++ algorithm for heightmap to mesh", got code to do a
simple two-triangle-per-quad solution. That didn't match the OpenSCAD
use of a center point to get four triangles, so I asked that question
generally and got a "not worth the effort" answer. Re-phrased the
question a bit more specifically, this time I got an answer that codes
up quite nicely.
I'm not a licensed computational geometrist, just a model railroader
trying to make stone walls. In that regard, I'm finding the LLM
assistance to be useful in making hay.
Glenn Butcher
On 10/3/2025 9:09 AM, Cory Cross via Discuss wrote:
On 9/28/25 4:25 PM, vulcan_--- via Discuss wrote:
Roel gave me the idea of using vcpkg to install all the dependencies
i need to clear up some include file problems in Visual Studio Code
in Windows 11.I am using the instructions to make a helloworld app just to see how
it should work .. but the instruction so not work ..
I've noticed you have lots of questions about random details. I'm not
shilling, but I have found LLMs to be very useful at answering these
questions. I have been leaning on google's for help with C++ syntax
because I know a set of words describing a concept, but it's not easy
to use a normal web search for things with symbols and the LLM gets
the right answer despite using symbols or using synonyms. It's also
good at posting a code snippet and an error message and getting the
answer fast.
Don't ask it how to convert from the parser C %union to C++ variant,
it'll just hallucinate an easy answer.
It's also a free list and feel free to continue to post here. Your
email client isn't setting reply headers correctly though, I'd
appreciate if you fixed it, but it's not a big deal.
-Cory
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Oh, regarding LLM and cmake, it's not a bad source for pulling together
'how do I do this?' solutions. Documentation is quite comprehensive,
but not 'howto' helpful. Also not interested in becoming a cmake
engineer, just need to get things done.
On 10/3/2025 9:09 AM, Cory Cross via Discuss wrote:
On 9/28/25 4:25 PM, vulcan_--- via Discuss wrote:
Roel gave me the idea of using vcpkg to install all the dependencies
i need to clear up some include file problems in Visual Studio Code
in Windows 11.I am using the instructions to make a helloworld app just to see how
it should work .. but the instruction so not work ..
I've noticed you have lots of questions about random details. I'm not
shilling, but I have found LLMs to be very useful at answering these
questions. I have been leaning on google's for help with C++ syntax
because I know a set of words describing a concept, but it's not easy
to use a normal web search for things with symbols and the LLM gets
the right answer despite using symbols or using synonyms. It's also
good at posting a code snippet and an error message and getting the
answer fast.
Don't ask it how to convert from the parser C %union to C++ variant,
it'll just hallucinate an easy answer.
It's also a free list and feel free to continue to post here. Your
email client isn't setting reply headers correctly though, I'd
appreciate if you fixed it, but it's not a big deal.
-Cory
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I too have found LLMs helpful in working with OpenSCAD (and other languages
for that matter). I was trying to use B-splines, and it suggested that the
easiest thing to do was to make the point list in some other language and
then c&p in into OpenSCAD. It even offered to prepare a python program to
do it. I'm aware that BOSL2 has spline functionality, but it wasn't doing
what I wanted and this approach worked fine.
Of course, LLMs do hallucinate, but I know OpenSCAD and python both well
enough to recognize that the answer was correct and usable.
On Fri, Oct 3, 2025 at 2:35 PM Glenn Butcher via Discuss <
discuss@lists.openscad.org> wrote:
Oh, regarding LLM and cmake, it's not a bad source for pulling together
'how do I do this?' solutions. Documentation is quite comprehensive,
but not 'howto' helpful. Also not interested in becoming a cmake
engineer, just need to get things done.
On 10/3/2025 9:09 AM, Cory Cross via Discuss wrote:
On 9/28/25 4:25 PM, vulcan_--- via Discuss wrote:
Roel gave me the idea of using vcpkg to install all the dependencies
i need to clear up some include file problems in Visual Studio Code
in Windows 11.
I am using the instructions to make a helloworld app just to see how
it should work .. but the instruction so not work ..
I've noticed you have lots of questions about random details. I'm not
shilling, but I have found LLMs to be very useful at answering these
questions. I have been leaning on google's for help with C++ syntax
because I know a set of words describing a concept, but it's not easy
to use a normal web search for things with symbols and the LLM gets
the right answer despite using symbols or using synonyms. It's also
good at posting a code snippet and an error message and getting the
answer fast.
Don't ask it how to convert from the parser C %union to C++ variant,
it'll just hallucinate an easy answer.
It's also a free list and feel free to continue to post here. Your
email client isn't setting reply headers correctly though, I'd
appreciate if you fixed it, but it's not a big deal.
-Cory
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org