Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


Netgen compilation issues on Windows

  • Karagiosis


    I could compile Netgen on Windows with MS Visual C++ Express edition. However, I cannot run the executable that I obtained.

    Firstly, I was not sure which of the "Configurations de solutions" to choose. I chose the "Debug" one and not the "Release" one.
    I assume that one chooses the "Release" configuration once all problems are solved. Could someone confirm this ?

    The folder from which I compiled Netgen was

    I observed that the executable netgen.exe was created in

    When trying to start netgen.exe, an error message tells that pthreadsVC2.dll cannot be found and therefore that netgen cannot start.
    However, I checked that this file is present in

    (...strange that it is in a "lib" folder and not in a "bin" one, no?)

    Should I rename the "netgen-4.9.6" folder to "netgen" before compiling? Would this help netgen finding the thread library ?

    I also observed in the BuildLog.htm file which resulted from the compilation that there were a lot of warnings, especially concerning conversions from double precision values to float ones.

    For the installation, I followed this procedure:

    Concerning the "Microsoft Windows SDK" that Netgen requires, I think it came with MS Visual C++. I also could not find the dowload link for the Windows SDK on Microsoft's site. Where is it ?

    Another thing that I don't understand is why are the Redistributable Library Packages required on the development machine required. Is MS Visual C++ not sufficient ?
    (On other machines I understand.)

    Lastly, I tried a compilation of Netgen with OpenCASCADE.
    The compilation failed. The compilation errors I get tell that "utilities.h" is lacking.

    Thanks for your help.


    • Hello Julien,

      A Good Day to you !

      Great to hear that you were able to successfully compile Netgen using Microsoft Visual C++ Express Edition.

      So... now to answer all your queries:

      1. The version you are trying to compile (Netgen-4.9.6) is currently not the latest, and I strongly suggest that you download the latest version of Netgen from the SVN repository. There have been some important bug-fixes since version 4.9.6 (for example, the utilities.h file has been added into the latest version)

      2. If you are compiling using the Tcl/Tk, Tix, Togl and pthreads libraries which you downloaded from the Netgen website, then you can only compile Netgen in the "Release" or the "Release(OCC)" configurations, because the downloads contain only the release versions of the external libraries.... if you want to build the "Debug" configuration, you need to first compile Tcl/Tk, Tix, Togl and pthreads in their respective debug modes.

      3. You can safely ignore the warnings in the build log concerning data conversions (from double precision to float).... these are harmless

      4. You need to modify the PATH environment variable in your Windows machine to include the path to the various DLLs of the external libraries (Tcl/Tk, Tix, Togl, pthreads) so that when you finally run the executable, Netgen can find those DLLs.

      5. Yes... you need to have the folder name "netgen" instead of "netgen-4.9.6" as the root below which all the individual source files are.... only then will the installation routine work properly.... you need to have the directory structure exactly like in the Wiki for everything to work smoothly without having to modify anything in the solution file.

      6. You are right that you do not need to install the Visual C++ redistributable packages on the development machine.... I have corrected the Wiki.... sorry for the oversight...

      7. Microsoft Visual C++ 2008 has the Windows Platform SDK included with it, so you dont need to install it separately.... only if you are using Microsoft Visual C++ 2005 you need to manually install the Platform SDK.

      Soo... I think I have answered all the questions :-) !?

      If you have any further problems... feel free to get back to me...

      Have a nice day!


    • Hello Philippose,

      Thanks a lot for your patience and your very detailed answer to the (too) many questions I asked.

      I'm sure that your post will also be useful to other newbies on the proper manner to compile Netgen on Windows.

      Have a nice day.
      Best regards.