1

I have a MacOS project that needs to compile on Windows. I've been using win32-clang-msvc compiler which seems to be the only included compiler that supports objective-c compilation. However, my files have #import statements that that compiler does not support and are using some MacOS libraries/frameworks (like foundation).

I've installed GNUstep msys, core and devel components, but I have no idea what is all the data I need to enter into Qt add compiler menu to have it actually work. Do I use c++.exe or cpp.exe? Do I use gcc.exe? Where is the make path? How to write a mkspec for it?

Is there any documentation on that for GNUstep?

Karlovsky120
  • 6,212
  • 8
  • 41
  • 94

1 Answers1

0

You can add custom compilers in Qt using the QMAKE_EXTRA_COMPILERS variable.

We’ve used this method to support building Objective-C sources on Android using GNUstep. You can check out the example project, which contains an objc-gnustep.pri file with the compiler definition for Objective-C sources. This should similarly work on Windows as well.

That being said I am not sure your setup using Clang and GNUstep MSYS packages will work as-is, as the GNUstep MSYS packages/libraries are probably built with GCC using MinGW libraries, whereas you would be using Clang with the MSVC runtime libraries. GCC comes with an Objective-C runtime, but using Objective-C with Clang requires the external libobjc2 runtime, which currently doesn’t seem to be compatible with MinGW as recently discussed on the mailing list. That being said I’d love to know if you can get it to work.

For the time being, instead of using Clang your best option might be using GCC from MinGW with the GNUstep packages, but note that this doesn’t support Automatic Reference Counting (ARC) and some other features only supported by Clang/libobjc2.

Frederik
  • 467
  • 6
  • 16