- C compiler identification is unknown despite setting CC and CXX variables
- 1 Answer 1
- Идентификатор компилятора CXX неизвестен
- Решение
- Другие решения
- The CXX compiler identification is unknown
- 14 Answers 14
- CMake: The C compiler identification is unknown
- 2 Answers 2
- C & CXX compiler identification is unknown
- 1 Answer 1
C compiler identification is unknown despite setting CC and CXX variables
I’m using the command:
How is it possible when I set those variables right there?
EDIT: Error log file:
1 Answer 1
The compiler can be selected by using the CC and CXX variables, but by it’s much more complicated than using the -G (generator) parameter. For one, the slashes in the path must be Unix style ( / ) and they don’t take effect after the first time CMake configuration is ran unless the cache is cleared.
For a list of available generator options include the —help option
The paths to the Boost library must also use Unix style slashes ( / ). Many of the commands will convert Windows paths, but when passing in definitions at the command-line you’ll want to always use Unix style paths.
Your command would change to the following:
cmake -G «Visual Studio 12 2013 Win64″ -DBOOST_ROOT=»C:/local/boost_1_56_0″ -DBOOST_LIBRARYDIR=»C:/local/boost_1_56_0/lib64-msvc-12.0» ..
You’ll also want to make sure that your PATH environment variable is setup correctly for Visual Studio and x64. This can be done easily by opening a VS2013 x64 Native Tools Command Prompt using the command below:
In addition, you should make sure you’re clearing out the cmake cache before you try. The easiest way to do this is to delete your cmake build folder, but you can also use the CMake-gui to clear the cache.
Идентификатор компилятора CXX неизвестен
У нас возникают проблемы при компиляции проекта с использованием CMake (v2.8.12) под Windows 7 64Bit с использованием Visual Studio 2012. CMake выдает нам следующие ошибки. Мы уже пытались запустить Cmake из командной строки Visual Studio, используя права администратора. Кажется, в CMake 2.8.11 была похожая ошибка: http://www.cmake.org/Bug/view.php?id=14440
Решение
У меня была та же проблема, и я исправил ее, запустив cmake как Admin
Другие решения
У меня была похожая проблема также, если вы используете Microsoft Visual Studio 2012, это может быть из-за обновления KB2781514 пропал, отсутствует.
После того как я установил следующее обновление, CMake начал правильно определять компиляторы Visual Studio 2012 c / c ++.
Эти сообщения об ошибках
означает, что CMake действительно нашел или предполагал компилятор, но не смог скомпилировать простую тестовую программу.
Взгляни на CMakeFiles\CMakeError.log и проверьте там сообщение об ошибке, чтобы увидеть:
- какой путь компилятора / командную строку использовал CMake
какое сообщение об ошибке вызывало компилятор
например LINK : fatal error LNK1181: cannot open input file ‘kernel32.lib’
Если вы добавите —debug-trycompile к cmake вызов CMake даже сохранит файлы, которые он пытался протестировать при компиляции (так что вы можете скопировать / вставить / повторно запустить командную строку из журнала ошибок в вашем cmd ракушка).
В прошлый раз у меня была эта проблема …
В прошлый раз у меня возникла эта проблема, когда моя стандартная установка Visual Studio 2012 Professional не установила Windows SDK (в журнале ошибок отображался отсутствующий заголовок SDK).
Чтобы проверить установку SDK, например, убедитесь, что у вас установлен любой Resource Compiler. Это должно быть в пути, похожем на:
Так как мне не хватало этого — или точнее любого SDK — я установил Windows 8.1 SDK (поскольку Visual Studio 2012 предназначена для Windows 8.x) и вуаля, мой CMake снова смог скомпилировать (тестировать) программы.
Ссылка
Та же проблема здесь с cmake 2.8.12 и visual studio 10. Cmake может не найти компилятор. Я решил проблему, удалив последнюю версию и установив cmake 2.8.10.
Я только сталкиваюсь с этой проблемой, после того, как я удалил некоторое программное обеспечение MS.
Я исправил это путем ремонта visual studio 2012.
Сначала зайдите в [Панель управления], затем выберите Visual Studio и восстановите его, все пойдет прямо сейчас.
Убедитесь, что вы выбрали правильную версию Visual Studio.
Например, Visual Studio 2012 является версией 11.
У меня была такая же проблема, и я должен был использовать «File -> Delete Cache» , так как я случайно настроил CMake для использования неправильной версии Visual Studio.
Если вы используете CMake 3.4.0, попробуйте обновить его до более новой версии. Ошибка относительно этого была исправлена относительно недавно (см. сообщение об ошибке ).
The CXX compiler identification is unknown
We are having trouble compiling a project using CMake (v2.8.12) under Windows 7 64Bit using Visual Studio 2012. CMake gives us the following errors. We already tried starting Cmake from the Visual Studio Command Line using admin rights. There seems to have been a similar bug in CMake 2.8.11: http://www.cmake.org/Bug/view.php?id=14440
14 Answers 14
I had the same issue and fixed it running cmake as Admin
Those error messages
means CMake did find or assume a compiler but it wasn’t able to compile a simple test program.
Take a look at CMakeFiles\CMakeError.log and check the error message there to see:
- which compiler path/command line CMake did use
what the error message calling the compiler was
e.g. LINK : fatal error LNK1181: cannot open input file ‘kernel32.lib’
If you add —debug-trycompile to the cmake call CMake will even keep the files it has tried to test compile (so you can copy/paste/re-run the command line from the error log in your cmd shell).
The last time I had this problem .
The last time I had this problem was when my Visual Studio 2012 Professional standard installation did not install any Windows SDK (the error log was showing an missing SDK header).
To verify your SDK installation e.g. check that you have any Resource Compiler installed. It should be in a path similar to:
Since I was missing this — or more accurate any SDK — I installed Windows 8.1 SDK (since Visual Studio 2012 does target Windows 8.x) and voila my CMake was able again to compile the (test) programs.
CMake: The C compiler identification is unknown
I am trying to build a project by cmake 2.8.12 with visual studio 10 in 32bit architecture. But I am getting these error and cmake is unable to create the project. Can anyone please suggest me a solution. Thanks.
This is the error showing in cmake-gui window:
2 Answers 2
- Remove Cmake cache
- Start Visual Studio 10 (Win32) Command Prompt
- Verify that cl command works
- Generate with cmake -G «Visual Studio 10» .
Below changes worked fine for me:
Set the path in PATH : C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
Clear cmake cache
The following generators are available on this platform:
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files. Optional [arch] can be «Win64» or «ARM».
Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files. Optional [arch] can be «Win64» or «ARM».
Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files. Optional [arch] can be «Win64» or «ARM».
Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files. Optional [arch] can be «Win64» or «IA64».
Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files. Optional [arch] can be «Win64» or «IA64».
Visual Studio 8 2005 [arch] = Generates Visual Studio 2005 project files. Optional [arch] can be «Win64».
Visual Studio 7 .NET 2003 = Generates Visual Studio .NET 2003 project files.
Visual Studio 7 = Deprecated. Generates Visual Studio .NET 2002 project files.
Visual Studio 6 = Deprecated. Generates Visual Studio 6
Used exactly same as above list which was Visual Studio 11 2012
cmake -G «Visual Studio 11 2012» ..\..\source && cmake-gui ..\..\source
C & CXX compiler identification is unknown
I am a new user of Linux and trying to download Avogadro 1.2.0. I’m having trouble using the command cmake ../ , when I do it says
— The C compiler identification is unknown
— The CXX compiler identification is unknown
I believe that I need to make some changes to the CMakeLists.txt in the package source directory, but have no idea how to do so.
I changed the minimum required from VERSION 2.8.9 to VERSION 2.8.12, maybe it has to something with it?
The code is very long so I just added the first 27 lines if need it.
Any suggestions of what can I do?
1 Answer 1
This answer is based on the assumption you are running Ubuntu, as you do not explicitly specify which Linux distribution you are running. I am assuming Ubuntu, since you have that as a tag.
CMake requires a working C or C++ compiler to compile code. The output you provided is telling you that CMake failed to find a C or C++ compiler installed on your computer.
Several compilers are available for Linux. A popular C++ compiler is g++ .
g++ , gcc , and make can be installed on Ubuntu using apt by running the following two commands:
I assume the Avogadro you are trying to install is this program. Please note that the installation instructions specify the tools required to build and install from the source code. You will need CMake (which you appear to already have installed), a working C++ compiler, GNU make, and the other two tools specified. Please install all build tools before you try to build Avogadro.