Objective-C++ in Visual Studio 2017

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.

Bjoern Gaier wrote:

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.

What filename extension are you using for your Objective-C file? The usual one for that language is “.m”. If you’re using something different, try that.

Bjoern Gaier wrote:

> 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.

What filename extension are you using for your Objective-C file? The usual one for that language is ".m". If you're using something different, try that.

Objective-C++ uses ".mm".

John.