[vtkusers] Build VTK with MinGW

Berti Krüger berti_krueger at hotmail.com
Sat Sep 15 01:33:51 EDT 2018


That's why i was recommending him to install msys2. With msys2 you get a linux-like environment in Windows with the complete toolchain (bash, cmake, gcc, make, python, openjdk, tcl / tk, etc.) and all the libraries needed (including Qt).

For the vtk build system it looks like it is running under linux. So when using the vtk build instructions for linux everything works out of the box.

By simply copying my vtk / qt source project files from linux to windows and running qmake (for qt) i was able to get a Windows build of my program without any additional work. Depending on other factors your mileage may vary of course.

The executable produced by this setup runs in a standard Windows environment without msys2 installed.

But you are right of course, if you don't need to have a consistent runtime behaviour on all platforms you can simply use Visual Studio on Windows since it is free anyway and much better supported.


Regards,

Berti

Am Do, 13. Sep, 2018 um 4:21 NACHMITTAGS schrieb Allie Vacanti <allison.vacanti at kitware.com>:
It's also worth pointing out that VTK does not officially support the MinGW compilers. After you resolve this issue, there will likely be many more problems to fix before you have a working build.

The supported compilers on the Windows platform are currently MSVC 2013 or later.

On Wed, Sep 12, 2018 at 7:36 AM, Fcs <ftpronk at engits.com<mailto:ftpronk at engits.com>> wrote:
Hello Tobias,

I think the problem you are having is that you are trying to mix two
programs compiled with different toolchains. Programs compiled with MinGW
are NOT compatible/linkable with programs compiled with the MSVC toolchain.
If you look at "C:\Windows\System32\opengl32.dll", it depends on MSVCRT.dll
which is the C standard library for Visual C++ (MSVC).

You have two choices:
 - Either you stick with MinGW, and you compile all your dependencies with
it (VTK, Qt, python, OpenGL..) so that the linking works
 - Or you stick with the MSVC toolchain, and compile all your dependencies
with it (or download them, as the most common libraries are readily
installable with MSVC compatibility), which will allow you to also link to
system libraries / system OpenGL.

>From experience, the second option is by far the easiest, especially if you
start doing funky things..

If you choose to go down the MinGW route (good luck..), the Khronos group
has some instructions on their website for OpenGL support with MinGW:
https://www.khronos.org/opengl/wiki/MinGW

If you feel adventurous, their is an experimental third option, using the
excellent clang toolchain. Apparently it has (partial?) MSVC compatibility,
which would allow you to compile and link your code with libraries compiled
with MSVC.

Kind regards,

Francois.





--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180915/2f71b106/attachment.html>


More information about the vtkusers mailing list