Conan: MSVC compiler check fails

Created on 29 Jun 2017  路  8Comments  路  Source: conan-io/conan

I am trying to build this project. This is on Windows 7. I have tried in the MSYS MINGW64 shell and powershell and get the same results. I have Visual Studio 2015 Professional installed, and cl.exe is on the system (I have built other things in cmake with it). I have tried this with and without cl.exe.

This is my conanfile.txt:

[requires]
Boost/1.63.0@eliaskousk/stable
Qt/5.7.1@osechet/stable
gtest/1.8.0@lasote/stable
OpenSSL/1.0.2h@lasote/stable

[generators]
cmake

This is my command line output:

$ cmake -G "Visual Studio 14 2015 Win64" ..
CMake Error at build/conanbuildinfo.cmake:583 (message):
  This project seems to be plain C, but no compiler defined
Call Stack (most recent call first):
  build/conanbuildinfo.cmake:372 (conan_check_compiler)
  CMakeLists.txt:5 (conan_basic_setup)


-- Configuring incomplete, errors occurred!

This is the offending function.

question

Most helpful comment

Yes, you need to put the include and conan_basic_setup() lines after the project() declaration.

All 8 comments

Hi @vadixidav ,

I would need more info, specially regarding the installation. First, when you executed conan the first time, it detected some defaults about your environment, and printed them. Do you remember them? You can check them in your <userhome>/.conan/conan.conf file.

This were probably the settings used when you installed the dependencies from your conanfile.txt, and it seems that when you are running cmake with Visual Studio 14, it is complaining, because the dependencies were installed for a different configuration than yours.

This has several solutions:

  • Change your default settings in conan.conf to be the ones you want to use
  • Provide your settings in the command line while installing
  • Define a profile and use it in the command line while installing.

This is my conan.conf file. Each time I've ran it, it has been in the same manner. I have also tried clearing out the build directory.

My suspicion is that, when looking at the CMake file conan generated, that it is expecting Visual Studio 14 Win64, whereas my CMake seems to have the generator Visual Studio 14 2015 Win64. I am not sure if that would throw it off. As far as I can tell, the conan configuration is probably right, but I am no expert.

Could you try adding CXX in your CMakeLists.txt file? Something like:

project(MYPROJECT CXX)

If you could please copy the whole output of the cmake command, that would help too. Thanks!

Here is what it looks like on the command line. I added that CXX thing to my project and that gave the same results.

This is the CMakeLists.txt, which I know is not currently correct, but I want to be able to get to that stage at least.

Yes, you need to put the include and conan_basic_setup() lines after the project() declaration.

Oh, I see, that was indeed the issue. Thanks, I'll close this.

Great! :)

Was this page helpful?
0 / 5 - 0 ratings