I am attempting to do the “Visual Studio” build of the KiCad source. I got vcpkg and installed the packages according to the website notes.
I can compile the x64_debug versions of the KiCad elements such as KiCad, EESchema etc using Visual Studio. I can even run the individual programs in debug mode.
I have two problems when I attempt to use the “Install” version of KiCad
The program complains that it is missing DLLs. The DLLs do not seem to have been copied across to the Install directory when the “Install” version of KiCad was built. I manually searched the vcpkg packages and found the relevant DLLs then copied them over into the Install directory and I could then launch the “Install” version of Kicad. Is there some way to modify the settings so that the DLLs are copied across automatically?
KiCad cannot launch subprograms like eeschema from the button menu. It claims that it cannot load the “eeschema.kiface” DLL even though the DLL is in the directory. Looking around the forums, it appears that the DLLs can fail to load if they are missing dependencies. How do I determine these dependencies and again how can I get them to automatically copy across?
EDIT: Using Windows 10 and Visual Studio Community 2019
You have to make a launch.vs.json to give visual studio launch configuration and tell it PATH to the vcpkg bin. I’ve been meaning to provide a sample in the source tree but :busy:
KiCad cannot launch subprograms like eeschema from the button menu. It claims that it cannot load the “eeschema.kiface” DLL even though the DLL is in the directory. Looking around the forums, it appears that the DLLs can fail to load if they are missing dependencies. How do I determine these dependencies and again how can I get them to automatically copy across?
If working with a debug build. Copy the dlls from vcpkg/installed/x64-windows/debug/bin and not vcpkg/installed/x64-windows/bin
Hi, I have both problems: 1st one (missing dlls) is solved by copying dlls from vcpkg\installed\x64-windows\debug\bin, but I cannot solve 2nd problem (kiface not found), even when missing kiface files exist in exe (pcbnew.exe) directory. I have followed these instructions: https://dev-docs.kicad.org/en/build/windows-msvc/ (great article), and stuck with exact problems as in this OP.
Are you just running from the build directory? If so, you’ll want to set KICAD_RUN_FROM_BUILD_DIR in your launch environment.
(I cannot find output exe files in solution tree (I probably do not want to add them manually to soulution tree??), as this article states
You’ll want to read documentation for working with CMake projects, not documentation for working without a project at all. VS2019 has CMake integration and you’ll want to understand how things like CMakeSettings.json and launch.vs.json work. The build outputs should not show up in the solution tree, but you should have launch configurations set up for debugging any of the applications you want to debug.
VS first started, I have opened some cpp file from “Solution Explorer” tree, to keep one of the source file open;
Select “x64-Debug” configuration;
Select startup item “kicad.exe (Install)”;
Click green “build (play)” button;
(“build” button is greyed out here, because building is in progress)
Mentioned two issues arose after building is completed (no dll and kiface). Executables are found in kicad\build\install\bin subfolder, if remembered correctly.
Thank you Jon, I failed to launch standalones in professional way… The way that worked for me (eeschema / pcbnew begin to load kiface files) was to copy paste all dlls from kicad nightly installation (C:\Program Files\KiCad\5.99\bin) to \kicad\build\install\x64-Debug\bin or kicad\build\x64-Debug\eeschema folders. Here is a similar thread