VS2017 versus VS2015: behavior different on the cl compiler environment variables: INCLUDE, LIB

zosrothko's Avatar

zosrothko

20 Mar, 2018 03:25 PM

Hello

One have 2 jobs exactly identical except that one is compiling with VS2017 and the second is compiling with VS2015 and the one with the VS2017 compiler is failing
VS2017: https://ci.appveyor.com/project/zosrothko/poco/build/build%20develo...
VS2015: https://ci.appveyor.com/project/zosrothko/poco/build/build%20develo...
Look in both case at the compilation of the module MySQL: "Building [MySQL_"
for the VS2017, you will finf the compilations under Building [MySQL_vs150.vcxproj] which are KOs
for the VS2015, you will finf the compilations under Building [MySQL_vs140.vcxproj] which are OKs

Could you have an idea of what is going on?

  1. Support Staff 1 Posted by Owen McDonnell on 21 Mar, 2018 07:17 PM

    Owen McDonnell's Avatar

    From what i can see this earlier commit, in which the mysql project compilation failed, and this later commit both used Visual Studio 2017 image. The only difference being some different environment variables ('vsver' being changed from 150 to 140).
    Am I missing something?

  2. 2 Posted by zosrothko on 21 Mar, 2018 07:34 PM

    zosrothko's Avatar

    Hello

    You are right, the only difference is the vsver variable which I
    switched between the two commits. May be it could be related to the
    MSBuild version... As you can see, the msbuild command is exactly the
    same in both jobs...

    Le 21/03/2018 à 20:17, Owen McDonnell a écrit :

  3. Support Staff 3 Posted by Owen McDonnell on 21 Mar, 2018 10:17 PM

    Owen McDonnell's Avatar

    Yes, msbuild seems to be the same, but i'm wondering about the following difference:
    In unsuccessful build...

    C:\projects\poco\buildwin.cmd  150 build shared release Win32 samples tests msbuild env minimal
    **********************************************************************
    ** Visual Studio 2017 Developer Command Prompt v15.6.2
    ** Copyright (c) 2017 Microsoft Corporation
    **********************************************************************
    [vcvarsall.bat] Environment initialized for: 'x86'
    ########################################################################
    ####
    #### STARTING VISUAL STUDIO BUILD (vs150, x86)
    ####
    ########################################################################
    
    while in successful build,
    C:\projects\poco\buildwin.cmd  140 build shared release Win32 samples tests msbuild env minimal
    ########################################################################
    ####
    #### STARTING VISUAL STUDIO BUILD (vs140, Win32)
    ####
    ########################################################################
    
    Based on a look at your 'buildwin.cmd' script i'm not sure how the platform was set to 'x86' instead of 'win32'.
    Any ideas?
  4. 4 Posted by zosrothko on 22 Mar, 2018 10:28 AM

    zosrothko's Avatar

    In fact the 'x86' versus 'Win32' is just a bug in the display. But both msduild command are identical with the same value for the parameter /p:Platform: /p:Platform=Win32

    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++ Building [MySQL_vs150.vcxproj]
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      msbuild /clp:NoSummary /nologo /v:minimal /logger:"C:\Progra~1\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:UseEnv=true /m /t:build /p:Configuration=release_shared /p:Platform=Win32 MySQL_vs150.vcxproj
      Vcpkg is unable to link because we cannot decide between Release and Debug libraries. Please define the property VcpkgConfiguration to be 'Release' or 'Debug' (currently 'release_shared').
      Binder.cpp
    c:\projects\poco\sql\mysql\include\poco\sql\mysql\binder.h(24): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory [C:\projects\poco\SQL\MySQL\MySQL_vs150.vcxproj]
      Connector.cpp
    c:\projects\poco\sql\mysql\include\poco\sql\mysql\sessionhandle.h(20): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory [C:\projects\poco\SQL\MySQL\MySQL_vs150.vcxproj]
      Extractor.cpp
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ Building [MySQL_vs140.vcxproj] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ msbuild /clp:NoSummary /nologo /v:minimal /logger:"C:\Progra~1\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:UseEnv=true /m /t:build /p:Configuration=release_shared /p:Platform=Win32 MySQL_vs140.vcxproj Vcpkg is unable to link because we cannot decide between Release and Debug libraries. Please define the property VcpkgConfiguration to be 'Release' or 'Debug' (currently 'release_shared'). Binder.cpp Connector.cpp Extractor.cpp


    Moreover, the 2 MySQL.vcxproj file are identical except for the ToolsVersion(14.0/15.0) and the <PlatformToolset>(140/141)
  5. Support Staff 5 Posted by Owen McDonnell on 22 Mar, 2018 07:17 PM

    Owen McDonnell's Avatar

    In the unsuccessful build I referenced the environment vcvars seem to get initialized while in the successful ones they don't... is this section of the 'buildwin.cmd' working as intended?

    if "%1"=="" goto usage
    set VS_VERSION=vs%1
    if %VS_VERSION%==vs150 (
      if "%VS150COMNTOOLS%"=="" (
        set VS150COMNTOOLS=C:\Program Files ^(x86^)\Microsoft Visual Studio\2017\Community\Common7\Tools\
      )
      set VS_VARSALL=....\VC\Auxiliary\Build\vcvarsall.bat
    ) else (
      set VS_VARSALL=....\VC\vcvarsall.bat
    )
    

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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