NGSolve C++ addon

Dear NGSolve-community,

we have now a new template for implementing C++ addons:

It requires the current NGSolve prerelease (Mar 28) or newer.

Please let us know about any problems and possible improvements - and your own NGSolve addons as well.


I am using Windows 10 and trying to compile it with Visual Studio 2022.
I got the following message when compiling with my_ngsolve_addon.cpp.

C:\Program Files\Python310\Lib\site-packages\netgen\libngsolve.dll : fatal error LNK1107: File is invalid or broken.  can not read 0x340,

I am using Python 3.10.5.


Did you apply custom cmake flags? Seems like the build tools want to use libngsolve.dll instead of libngsolve.lib for linking.

Anyway, you need to use the latest NGSolve PRE-Release as stated above.
First update by running
pip install --upgrade --pre ngsolve
then try again.


1 Like