[cfe-dev] Objective-C++ in Visual Studio 2017

Bjoern Gaier via cfe-dev cfe-dev at lists.llvm.org
Thu Jun 28 23:25:42 PDT 2018


Hello everyone,

I have read that Clang is able to compile Objective-C code as well. So I tried out a simple Hello-Word-Program which I found in the internet.

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
    }
    return 0;
}


Compiling it via commandline with clang-cl works! I get an error message, but that is fine.

But if I add the file into a C++-Solution of Visual Studio where I'm running 'LLVM-vs2014' as a platform toolset and I try to compile it, then Clang will read the file as a C++-file and will complain about the import statement being not supported.

So is it just not possible to use Objective-C++ with Clang and Visual Studio or do I miss a flag or something?

Kind greetings
Björn Gaier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180629/ff1b6e1a/attachment.html>


More information about the cfe-dev mailing list