1

I cloned a library that i needed to use for a coding task and visual code auto-compiled its cmake automatically giving me this,i've already looked all over stack overflow and seen similar problems with cl.exe but the solutions dont seem to be anything that fits my problem, the error is following:

Severity    Code    Description Project File    Line    Suppression State
Error       CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/CMakeTestOBJCXXCompiler.cmake:62 (message):
  The Objective-C++ compiler

    "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe"

is not able to compile a simple test program. It fails with the following output:

Change Dir: D:/puzzlenew/out/build/x64-Debug (default)/CMakeFiles/CMakeTmp

Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_0f8c7 && [1/2] Building OBJCXX object CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '-x'
cl : Command line warning D9024 : unrecognized source file type 'objective-c++', object file assumed
cl : Command line warning D9027 : source file 'objective-c++' ignored
cl : Command line warning D9024 : unrecognized source file type 'testOBJCXXCompiler.mm', object file assumed
cl : Command line warning D9027 : source file 'testOBJCXXCompiler.mm' ignored
cl : Command line warning D9021 : no action performed
[2/2] Linking OBJCXX executable cmTC_0f8c7.exe
FAILED: cmTC_0f8c7.exe 
cmd.exe /C "cd . && C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe  /machine:x64 CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o -o cmTC_0f8c7.exe   && cmd.exe /C "cd /D "D:\puzzlenew\out\build\x64-Debug (default)\CMakeFiles\CMakeTmp" && C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy Bypass -file C:/src/win32/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary "D:/puzzlenew/out/build/x64-Debug (default)/CMakeFiles/CMakeTmp/cmTC_0f8c7.exe" -installedDir C:/src/win32/vcpkg/installed/x64-windows/bin -OutVariable out""
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '/machine:x64'
cl : Command line warning D9024 : unrecognized source file type 'CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o', object file assumed
Microsoft (R) Incremental Linker Version 14.28.29337.0
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:testOBJCXXCompiler.mm.exe 
/out:cmTC_0f8c7.exe 
CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o 
LINK : fatal error LNK1181: cannot open input file 'CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o'
ninja: build stopped: subcommand failed.



  

  CMake will not be able to correctly generate this project.        C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/CMakeTestOBJCXXCompiler.cmake 62  
273K
  • 29,503
  • 10
  • 41
  • 64
Weeby
  • 13
  • 2
  • 3
    It looks like the project you're tying to build is using Objective-C++, which as far as I know isn't supported by MSVC. Without a proper Objective-C++ Compiler I'm afraid you won't be able to compile this project. – Corristo Feb 27 '21 at 16:12
  • [this](https://stackoverflow.com/questions/56708/objective-c-for-windows) question may be relevant in this case. MSVC is not able to compile Objective-C++. – icebp Feb 27 '21 at 19:12
  • isn't there a way to tell MSVC that .m and .mm files are just C/C++ files? That would be handy in my case where I have a .m file with #ifdef to avoid the ObjC code when compiling on Windows – Valerio Santinelli Jul 03 '21 at 14:50

0 Answers0