MinGW or Cygwin with no-cygwin option for OCC 6.3

Dear all,
as I currently switched to the new Qt Creator and MinGW for the development in FreeCAD I have to regenerate also the necessary libs we use there.

I tried to compile OCC 6.3 the Linux way in cygwin with the no-cygwin option to allow also debugging libs afterwards in mingw. Of course, it did not work out of the box :(

So, I found numerous other threads dealing with the mingw question but none really came up with a solution !

Anybody out there with some tips how to get it to work? I think also the Code::Blocks, DevC++ users might be happy to have a mingw/cygwin based OCC6.3 lib.

Best regards,

Paul Jimenez's picture

I was able to build many OpenCASCADE modules with MinGW using Code::Blocks. Some patching and manual editing of project options were required along the way, and some tricks were also necessary because the list of files to send to the linker exceeded the command line limits in Windows. I gave up when I reached a module that required even more evil trickery to link the files.

The basic idea is to import a module at a time into Code::Blocks, add the missing defines and include directories that do not get imported (they are set per file, and Code::Blocks does not import that) and build. Once you hit an error, try to figure out what to do about it. Some require including extra header files, others changing the declaration of some symbols (most of them have the right declaration commented) and so on.

To force linking of those modules that exceed the command line limits, I just copied the full command line, removed the common part of the path from all object files, went to the right path in a console and issued the command.

Give it a try. If you get stuck, just post here the error and I will see what I did to get past it.

dvdjimmy's picture

Good morning Paul,

thank you for your offer. I have already seen your post quite some time ago. Yesterday I found a nice tool to convert vcproj files to cmake files. This works quite well at least for TKernel :) The goal would be to have a complete conversion to cmake to allow a build of occ for nearly all build system cmake supports. Of course, declaration changes might be hard to code into cmake !

One really bad thing I already encountered is, that OCC put the additional include dirs directly for the cxx files in the vcproj. This way the automatic conversion tool does not know the include dirs and therefore fails :( Maybe I have to enhance the conversion tool to take care of these include dirs as well. Otherwise this might become a very time consuming task for me!