Double click pcbnew.exe to launch it alone,but get a "Error loading editor" issue message box,how i to do?

After build and install the Kicad sources in msys2/mingw64 with the command line:

$cmake -DCMAKE_BUILD_TYPE=Release \
-G “MSYS Makefiles” \
-DCMAKE_PREFIX_PATH=/mingw64 \
-DCMAKE_INSTALL_PREFIX=/e/kicad-src/kicad-msys2/build/release/install \
-DDEFAULT_INSTALL_PATH=/e/kicad-src/kicad-msys2/build/release/install \
-DKICAD_DATA=/e/KiCAD-src/kicad-msys2/build/release/install/share/kicad \
-DKICAD_DEMOS=/e/KiCAD-src/kicad-msys2/build/release/install/share/kicad/demos \
-DKICAD_DOCS=/e/KiCAD-src/kicad-msys2/build/release/install/share/doc/kicad \
-DKICAD_LIBRARY_DATA=/e/KiCAD-src/kicad-msys2/build/release/install/share/kicad \
-DKICAD_TEMPLATE=/e/KiCAD-src/kicad-msys2/build/release/install/share/kicad/template \
-DOCC_INCLUDE_DIR=/mingw64/include/opencascade \
…/…/
$make install

and the binary files are now in /e/kicad-src/kicad-msys2/build/release/install directory,i made a lot of
effort in configurations , then the Kicad.exe,eeschema.exe,bitmap2component.exe,gerbview.exe,pcb_calculator.exe,pl_editor.exe are launch normaly alone,but when double click pcbnew.exe try to launch it alone,unexpectly get a “Error loading editor” issue message box,however when i copy the pcbnew.exe from /e/kicad-src/kicad-msys2/build/release/install/bin to /c/msys64/mingw64/bin,that is
the directory msys2/mingw64 be installed, the pcbnew.exe run successfully;I worked hard for a long time and I didn’t solve the problem.
how i to do?


attachment: the error informations and dialog window:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|pcbnew error |
|+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +|
| 加载编辑器时出错 |
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
|details: |
|++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|
|10:15:21: Failed to load shared library ‘E:\KiCAD-src\kicad-msys2\build\release\install\bin_pcbnew.dll’
| (error 0: 操作成功完成。) |
|10:15:21: 加载 kiface 库 ‘E:\KiCAD-src\kicad-msys2\build\release\install\bin\_pcbnew.dll’ 失败。 |
|10:15:21: 加载编辑器时出错。 |
|+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

You are likely missing some dll in the bin path for installed pcbnew.exe.
You can use software like dependencies to find which dll is missing.

dependenciesGui.exe tell me pcbnew.exe don’t call _pcbnew.dll Explicitly,so How is it called by pcbnew.exe ?

It does call _pcbnew.dll, just in a somewhat non standard way. Load that dll into the dependencies viewer to view actual dependencies.

How do pcbnew.exe load _pcbnew.dll , via python?If so,what need to configure in order to let pcbnew.exe load _pcbnew.dll correctly? thanks.

Not through python, this is how common/kiway.cpp · master · KiCad / KiCad Source Code / kicad · GitLab

You can read wxDynamicLibrary implementation to know platform specific details but whatever they do it does not show up in Dependencies for some reason. But rest assured, it does load _pcbnew.dll

You don’t need to configure anything to make it load, you just have to supply all of it’s dependencies on $PATH so that the program can find them. Tricky part is to know what all the dependencies are, that’s where the program I linked helps.
Alternatively you can launch pcbnew.exe under a debugger and it will give you more info to why something does not load. But I haven’t used msys2 environment since kicad switched to msvc+vcpkg toolchain on windows and I suggest you do the same.

Simple, it’s run-time dynamic linked and not load-time :wink:

vs

If you are learning to develop on Windows, these are concepts you should vaguely know.

I did initially built kicad step by step follow the docs:
Windows (Visual Studio) | Developer Documentation | KiCad, after vcpkg had been completed download and install dependent packages and cmake had been completed configure and generate, clicked the vs2022 “build/build all” menuitem,got the error :

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
build.ninja:20783: multiple outputs aren’t (yet?) supported by depslog; bring this up on the mailing list if it affects you
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

what to do to solve its issues? thanks

Unfortunately, you seem to have a broken windows environment that’s messing with VS.

You didn’t by chance add msys2 to PATH when installing msys2?

I don’t use Visua Studio but maybe you need to build specifically cmake target “all”, not do a “build all” which tries to build multiple environments at once, I think.

You reminded me,i add msys2 to PATH, Excited is that pcbnew.exe crossed the error.thanks.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.