[LLVMdev] Compiling As Obj-C or Obj-C++ On Windows

Reid Kleckner rnk at google.com
Wed Oct 1 15:01:26 PDT 2014


This is a horrible hack, but try adding:
-Xclang -x -Xclang objc++

If your files end in .mm, we will assume they are Obj-C++ by default.

Basically the clang-cl driver does not accept the same set of command line
flags that the gcc-style driver accepts because there are conflicts around
some commonly used options (-MD, for example). We make gcc-style flags
available in clang-cl on an as-needed basis assuming there are no
conflicts. Understandably, it is really confusing to users to have to
understand two sets of flags and it might be worth revisiting that decision.

The -Xclang flag is a workaround that bypasses both the gcc-style and
cl-style flags processing and directly accesses the clang -cc1 command line
flag set, which is yet again different from either of the first two.

On Wed, Oct 1, 2014 at 12:09 PM, Eric Mader <emader at gmx.us> wrote:

> I have some C++ source files that mix in small bits of Obj-C. On the Mac,
> these files are marked to be compiled as Obj-C++. Looking at the clang
> help, it seems that the option for that is "-ObjC++". However, when I add
> that in Additional Options I get an error message:
>
> CL> : error : invalid integral value 'bjC++' in '-ObjC++'
>
> I see this same message if I put "-Xclang" in front of "-ObjC++".
>
> Is there a way to get the code to compile as Obj-C++ on Windows?
>
> Regards,
> Eric Mader
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141001/7b89aeb2/attachment.html>


More information about the llvm-dev mailing list