question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unable to automatically determine compiler" message on configure/build

See original GitHub issue

Brief Issue Summary

When configuring or building a simple project using CMake Tools, the message

[rollbar] Unable to automatically determine compiler

appears many times in the output.

CMake Tools Log

[cms-client] Configuring using the "Visual Studio 15 2017" CMake generator
[cms-client] Configuring using the "Visual Studio 15 2017" CMake generator
[cmake] The C compiler identification is MSVC 19.14.26433.0
[cmake] The CXX compiler identification is MSVC 19.14.26433.0
[cmake] Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
[cmake] Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe -- works
[cmake] Detecting C compiler ABI info
[cmake] Detecting C compiler ABI info - done
[cmake] Detecting C compile features
[cmake] Detecting C compile features - done
[cmake] Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe
[cmake] Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.14.26428/bin/Hostx86/x64/cl.exe -- works
[cmake] Detecting CXX compiler ABI info
[cmake] Detecting CXX compiler ABI info - done
[cmake] Detecting CXX compile features
[cmake] Detecting CXX compile features - done
[cmake] Configuring done
[cmake] Generating done
[cmake] CMake Warning:
[cmake]   Manually-specified variables were not used by the project:
[cmake] 
[cmake]     CMAKE_EXPORT_COMPILE_COMMANDS
[cmake] 
[cmake] 
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1  ","isGenerated":false,"language":"C","sources":["main.c"]}}
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG  ","isGenerated":false,"language":"C","sources":["main.c"]}}
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MD /O1 /Ob1 /DNDEBUG  ","isGenerated":false,"language":"C","sources":["main.c"]}}
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG  ","isGenerated":false,"language":"C","sources":["main.c"]}}

And if I build the project:

[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build c:/example/build --config Debug --target example -- /m /property:GenerateFullPaths=true
[build] Microsoft (R) Build Engine version 15.7.180.61344 for .NET Framework
[build] Copyright (C) Microsoft Corporation. All rights reserved.
[build] 
[build] Build started 22/07/2018 17:16:48.
[build]      1>Project "C:\example\build\example.vcxproj" on node 1 (default targets).
[build]      1>Project "C:\example\build\example.vcxproj" (1) is building "C:\example\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
[build]      2>PrepareForBuild:
[build]          Creating directory "x64\Debug\ZERO_CHECK\".
[build]          Creating directory "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\".
[build]        InitializeBuildStatus:
[build]          Creating "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[build]        CustomBuild:
[build]          Checking Build System
[build]          CMake does not need to re-run because C:/example/build/CMakeFiles/generate.stamp is up-to-date.
[build]        FinalizeBuildStatus:
[build]          Deleting file "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
[build]          Touching "x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
[build]      2>Done Building Project "C:\example\build\ZERO_CHECK.vcxproj" (default targets).
[build]      1>PrepareForBuild:
[build]          Creating directory "example.dir\Debug\".
[build]          Creating directory "C:\example\build\Debug\".
[build]          Creating directory "example.dir\Debug\example.tlog\".
[build]        InitializeBuildStatus:
[build]          Creating "example.dir\Debug\example.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
[build]        CustomBuild:
[build]          Building Custom Rule C:/example/CMakeLists.txt
[build]          CMake does not need to re-run because C:/example/build/CMakeFiles/generate.stamp is up-to-date.
[build]        ClCompile:
[build]          C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\CL.exe /c /Zi /nologo /W3 /WX- /diagnostics:classic /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"example.dir\Debug\\" /Fd"example.dir\Debug\vc141.pdb" /Gd /TC /FC /errorReport:queue C:\example\main.c
[build]          main.c
[build]        Link:
[build]          C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\example\build\Debug\example.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:/example/build/Debug/example.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/example/build/Debug/example.lib" /MACHINE:X64  /machine:x64 example.dir\Debug\main.obj
[build]          example.vcxproj -> C:\example\build\Debug\example.exe
[build]        FinalizeBuildStatus:
[build]          Deleting file "example.dir\Debug\example.tlog\unsuccessfulbuild".
[build]          Touching "example.dir\Debug\example.tlog\example.lastbuildstate".
[build]      1>Done Building Project "C:\example\build\example.vcxproj" (default targets).
[build] 
[build] Build succeeded.
[build]     0 Warning(s)
[build]     0 Error(s)
[build] 
[build] Time Elapsed 00:00:02.13
[build] Build finished with exit code 0
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1  ","isGenerated":false,"language":"C","sources":["main.c"]}}
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG  ","isGenerated":false,"language":"C","sources":["main.c"]}}
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MD /O1 /Ob1 /DNDEBUG  ","isGenerated":false,"language":"C","sources":["main.c"]}}
[rollbar] Unable to automatically determine compiler {"lang":"CXX","fileGroup":{"isGenerated":true,"sources":["build/CMakeFiles/97dc947cd7023b12d597309df2d3148e/generate.stamp.rule"]}}
[rollbar] Unable to automatically determine compiler {"lang":"C","fileGroup":{"compileFlags":"/DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG  ","isGenerated":false,"language":"C","sources":["main.c"]}}

Platform and Versions

  • Operating System: Windows 10
  • CMake Version: 3.12.0
  • VSCode Version: 1.25.1
  • CMake Tools Extension Version: 1.1.0
  • Compiler/Toolchain: Visual C++ 2017

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
vector-of-boolcommented, Jul 27, 2018

Found the problem and have a fix. Should be released in a few hours along with a few other big fixes.

2reactions
go2shcommented, Jul 22, 2018

try

set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH "Compiler")
set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER} CACHE FILEPATH "Compiler")
Read more comments on GitHub >

github_iconTop Results From Across the Web

Eclipse Build Path Nesting Errors - java - Stack Overflow
The answer to the problem is hinted in the error message: ... What I did to resolve it was to go to Build...
Read more >
How to: View, save, and configure build log files - Visual ...
Learn how you can view, save, and configure build log files. These files provide information such as the command lines used for the...
Read more >
Trilinos Configure, Build, Test, and Install Reference Guide
Abstract. This document contains reference information on how to configure, build, test, and install Trilinos using the TriBITS CMake build system.
Read more >
Configure build variants | Android Developers
Find out how you can configure build variants to create different versions of your app from a single project.
Read more >
3 ways to solve Eclipse - main class not found error - Java67
Like many Java programmers who get "Error: Could not find or load main ... the JVM will start automatically if it's not able...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found