Updated compile directions on Windows?

Hi all,

I just ran into some issues following the compile instructions for Windows (http://kicad-source-mirror.readthedocs.io/en/latest/Documentation/development/compiling/#building-kicad-from-source)

Basically, I do the makepkg-mingw, it builds and installs everything, but when I run, it is missing DLL files. I tracked them down from the appropriate mingw-w64-* folder, and found kicad.exe to give “The procedure entry point <> could not be located in the dynamic link library libstdc+±6.dll” which is pretty cryptic. The only thing I can imagine is that the x86/64 bit libraries have been misorganized.

Then I tried the second set, building using cmake directly, and there were issues with cmake and the paths (probably a result of using the wrong shell, as the “mingw64_shell.bat” is not actually even available on my install). I did also confirm I have msys64 installed, in case I had accidentally used the x86 version or something.

Anyway, the build instructions are not working as written; have there been any recent modifications required?

Thanks,
-Alex

I would try https://github.com/KiCad/kicad-winbuilder

OK, will do. I thought the point of that was to actually generate the pkgbuild, which is what the compile instructions said to use, so when I checked, it looked like the same thing.

OK, I gave that a shot, removed all other msys installations, ran the make_all.bat.

It returns with “CMake Error at KiCad-Winbuilder.cmake:282 (file):”, failing due to not being able to rename /last_error to another file with a path. It looks in the cmake file like it should be resolving HOME_DIR to a location inside the folder, looks like it should be setting HOME_DIR to ./msys64/home but it is empty. There is a section where variables are set above (compile, support dirs), so I added

set( HOME_DIR “${CMAKE_SOURCE_DIR}/msys64/home” )
if( NOT EXISTS “${HOME_DIR}” )
file( MAKE_DIRECTORY “${HOME_DIR}” )
endif()

And it still seems to fail with the exact same error. So HOME_DIR is probably being defined somewhere but is incorrect or overridden. That’s my best guess for now. I’ll poke around later and see what else I can find.

Thanks,
-Alex

For posterity, I found that there is a pending pull request on the kicad-winbuilder (https://github.com/KiCad/kicad-winbuilder/pull/50/files)

After implementing this it fixed the HOME_DIR, but last_error was not being put there anyways. So there is some setup problem with msys.

Not really a kicad issue anymore, will try to take it up with the winbuilder guys.

Which of these list of instructions is the most upto date and actually work?

or

http://docs.kicad.org/doxygen/md_Documentation_development_compiling.html#build_windows

I’m just installing MSYS as I type this. Thanks.

I followed instructions from second link and it worked fine if memory doesn’t fail me.
I didn’t have to build oce either.

I have a problem installing MSYS2 on mys system as it has problems with gnupg for some reason. I keep getting invalide crypto engine errors.
I’m about to give up trying to compile kicad AT ALL.
Why does it have to be so difficult?

Because compiling is always difficult if there are many dependencies. That’s why kicad-winbuilder exists.

Do I have to have MSYS2 installed first to use winbuilder or does it handle that as well? Thanks.

It handles everything.
EDIT: you have to install cmake first, though.

That is not a good description of error. If you describe exact steps you took and paste console output or gui screenshot we would be able to help.
Using winbuilder is fine if you just want to build current master once. If you want to do some development work you will have to checkout specific branches, do incremental compilations and what not, winbuilder doesn’t allow you to do that.

Normally when I am setting up a Windows machine for development, I use winbuilder once to install all of the dependencies, and then it’s a lot easier to check out the Git repo and build manually.

1 Like

I’ve installed Cmake on Widows 10. I chose to NOT add Cmake to the system path (the default option). Was this the correct decision? Does winbuilder need this? Thanks.

You’ll need cmake in the path for the script to work. If for some reason you don’t want to add it to the system path, you could edit the batch scripts to set a hard-coded path to cmake, but I don’t really recommend that.