CMake unable to find Visual Studio 2008 Generator

patricksnape's Avatar

patricksnape

03 Nov, 2014 06:05 PM

Hi,

I often use CMake to build my projects and I'm having some trouble getting it to work properly on Appveyor. On my local machine, if I call

call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

and then run

cmake .. -G"Visual Studio 9 2008"

everything works as I would expect. However, on appveyor, if I call the above command, I get the following error:

-- The C compiler identification is unknown

This seems to be related to the error that user Timotei was seeing over here:

http://help.appveyor.com/discussions/problems/466-no-support-for-visual-studio-c-2008-and-2010

which is the same error I am seeing, but for Visual Studio 2010.

Any guidance would be greatly appreciated.

Patrick

  1. Support Staff 1 Posted by Feodor Fitsner on 03 Nov, 2014 09:42 PM

    Feodor Fitsner's Avatar

    Hi Patrick,

    There is VC++ 2008 Express installed on build workers. Could it be the problem?

  2. 2 Posted by patricksnape on 04 Nov, 2014 11:11 AM

    patricksnape's Avatar

    Hi Feodor,

    I also have the express edition installed on my personal machine, and everything seems to work fine. I'm not sure if this is a problem with appveyor, or perhaps a consequence of having so many Visual Studio versions installed side-by-side. I was mostly wondering if anyone else had seen this problem (as Timotei seems to have) and how they managed to remedy it.

  3. 3 Posted by github on 18 Dec, 2014 10:29 PM

    github's Avatar

    I've got the same problem when trying to use 2008 or 2010. Did you ever find a solution?

  4. 4 Posted by github on 22 Dec, 2014 12:38 PM

    github's Avatar

    I've dug into to problem a bit more and it appears that VS2010 has bren incompletely upgraded to SP1, which makes it unhappy so it refuses to compile. Could you fix this by following the steps in the error message?

    https://ci.appveyor.com/project/alamaison/libssh2/build/job/j1d4w0f9a8060ml5:
    "Only some of the Microsoft Visual Studio 2010 products on this computer have been upgraded to Service Pack 1. None will work correctly until all have been upgraded."

    VS2009 is more of a mystery: https://ci.appveyor.com/project/alamaison/libssh2/build/job/xtv7viwicf8y20le. The VS error says "The operation could not be completed. Unspecified error". It could be a similar problem, with a less helpful error message, or some incompatibility between the version of CMake on the node and Express VS Versions.

  5. 5 Posted by patricksnape on 22 Dec, 2014 01:17 PM

    patricksnape's Avatar

    Ah! That sounds very interesting Alex. I can confirm that I am currently still having these problems.

  6. Support Staff 6 Posted by Feodor Fitsner on 22 Dec, 2014 03:23 PM

    Feodor Fitsner's Avatar

    Will look into that.

    -Feodor

  7. Support Staff 7 Posted by Feodor Fitsner on 22 Dec, 2014 09:22 PM

    Feodor Fitsner's Avatar

    OK, guys VS 2010 SP1 has been installed to worker images. Give it a try and let me know how it goes.

    Btw, noticed libssh2 project creates builds with 32 jobs :) I don't know what's average job completion time but guess such a large build would take ages to complete. Could you possibly downsize it to a few configs only?

  8. 8 Posted by github on 22 Dec, 2014 10:55 PM

    github's Avatar

    That's fixed the error complaining about incomplete SP1 from VS2010. Now VS2010 is hitting the same error as VS2008.

    I've reduced the matrix size for libssh2. The build doesn't take that long. Are resources very contrained?

  9. Support Staff 9 Posted by Feodor Fitsner on 22 Dec, 2014 11:00 PM

    Feodor Fitsner's Avatar

    Well, the only constraint is a number of concurrent jobs per account which is 1 for Free plan.

    Unfortunately, I'm not a guru in c++ and thus I can't generate any idea regarding that issue. But if there is anything I can try doing on this side to help you troubleshoot the issue - let me know.

  10. 10 Posted by github on 23 Dec, 2014 02:39 PM

    github's Avatar

    It's hard to give sensible suggestions without direct access to the machine. I have a feeling I've seen this error before if the machine hasn't been restarted since installing VS. Was the image rebooted before making a snapshot?

    Also, are you sure the images come with the C++ components installed, not just the .net ones?

  11. Support Staff 11 Posted by Feodor Fitsner on 23 Dec, 2014 06:57 PM

    Feodor Fitsner's Avatar

    Well, yeah: http://www.appveyor.com/docs/installed-software
    2008 and 2010 had separate C++ sku and all others install all languages.

  12. 12 Posted by github on 23 Dec, 2014 07:05 PM

    github's Avatar

    There may be a clue in that list. It says VC++ 2010 Express is installed, but so is VS 2010. I notice in my error log output that CMake is trying to use devenv.exe to build the compiler-test exe. If it were using VC++ Express, the log would say VCExpress.exe instead. Can you confirm if they are both installed?

  13. Support Staff 13 Posted by Feodor Fitsner on 23 Dec, 2014 07:09 PM

    Feodor Fitsner's Avatar

    There are Express SKUs only and obviously there is no devenv.exe. I'm not sure how cmake detects SKU and whether it's possible to do the same through VCExpress.exe.

  14. 14 Posted by github on 23 Dec, 2014 07:13 PM

    github's Avatar

    I'm not sure I understand. CMake is able to v10 devenv.exe: https://ci.appveyor.com/project/alamaison/libssh2/build/16/job/8swlhn4tnpjyq0p5#L64

  15. Support Staff 15 Posted by Feodor Fitsner on 23 Dec, 2014 07:20 PM

    Feodor Fitsner's Avatar

    That must be a miracle :)

    According to various sources it shouldn't be there. We've never deployed full VS 2010 - maybe it was added with VS 2010 SP1? :-/

  16. 16 Posted by github on 23 Dec, 2014 07:31 PM

    github's Avatar

    I'm not familiar with VS for non-C++ development. Is it not also devenv.exe?

    I thought devenv.exe was used for everything (except express) but that it may or may not have C++ compilers installed with it.

  17. Support Staff 17 Posted by Feodor Fitsner on 23 Dec, 2014 07:36 PM

    Feodor Fitsner's Avatar

    The only case I could recall for using devenv with .NET was building .vdproj projects. All the rest is done with MSBuild. Thankfully, now we have WiX for doing MSI which works with MSBuild like a charm.

  18. 18 Posted by github on 23 Dec, 2014 07:40 PM

    github's Avatar

    Oh ok. I didn't realise that devenv wasn't the IDE but just the build system.

    In that case, what would happen if you removed VC2010 Express and let VS2010SP1 take over the job? Would there be any downsides?

  19. Support Staff 19 Posted by Feodor Fitsner on 23 Dec, 2014 07:47 PM

    Feodor Fitsner's Avatar

    Wait a second. I meant exactly the opposite - devenv is IDE, not a full-fledged build system. MSBuild is a build system. Sorry for adding confusion here.

    Regrading SP1 - we didn't remove VC++ Express before installing SP1. My guess it's being installed on top of it. Both devenv.exe and VCExpress.exe are there: https://ci.appveyor.com/project/FeodorFitsner/simple-console/build/...

    I don't know why it didn't work here: https://ci.appveyor.com/project/alamaison/libssh2/build/16/job/8swl... At a glance looks like solution file wasn't generated.

  20. 20 Posted by github on 23 Dec, 2014 08:25 PM

    github's Avatar

    This bug report looks interesting: http://www.cmake.org/Bug/view.php?id=12410. It sounds like CMake will always favour devenv if it is available.

  21. Support Staff 21 Posted by Feodor Fitsner on 23 Dec, 2014 08:50 PM

    Feodor Fitsner's Avatar

    Don't know if that helps but you can just delete devenv.exe :) you are the boss on worker vm!

    -Feodor

  22. Support Staff 22 Posted by Feodor Fitsner on 25 Dec, 2014 07:41 PM

    Feodor Fitsner's Avatar

    Hi Patrick,

    Look at this thread: http://help.appveyor.com/discussions/problems/1266-no-64bit-compile...

    Apparently, installing VS 2010 SP1 kills C++ compilers. Perhaps, this was affecting you either. Worker images were fixed so you could do another try.

  23. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:52 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac