locked
LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800'

    Question

  • When trying to compile for ARM release or debug,  I'm getting the following error.

    (oapmatrixmix.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800'

    I'm running Windows 8.1 update 1, Visual Studio 2013.

    The library XAPOBase.lib is in Configuration Properties->VC++ Directories->LibraryDirectories field of the project properties.  This library is used to implement a sound effect for XAudio2

    Thursday, April 10, 2014 9:43 PM

Answers

  • My workaround is to use a macro to prevent the code from being executed on ARM target.

    #if (_M_ARM)

        //
        // Create the source voice
        //
        DX::ThrowIfFailed(
            m_audioEngine->CreateSourceVoice(
            &implData->sourceVoice,
            format,
            0,
            XAUDIO2_DEFAULT_FREQ_RATIO,
            reinterpret_cast<IXAudio2VoiceCallback*>(&implData->callbackHander),
            nullptr,
            nullptr
            )
            );

    #else

        IUnknown* pXAPO;
        XAPO_REGISTRATION_PROPERTIES* reg = new XAPO_REGISTRATION_PROPERTIES();
        reg->MaxInputBufferCount = 1;
        reg->MinInputBufferCount = 0;
        reg->MaxOutputBufferCount = 1;
        reg->MinOutputBufferCount = 0;
        pXAPO = new TestLibXAPO(44100, reg);
        XAUDIO2_EFFECT_DESCRIPTOR descriptor;
        descriptor.InitialState = true;
        descriptor.OutputChannels = format->nChannels;
        descriptor.pEffect = pXAPO;
        XAUDIO2_EFFECT_CHAIN chain;
        chain.EffectCount = 1;
        chain.pEffectDescriptors = &descriptor;

        //
        // Create the source voice
        //
        DX::ThrowIfFailed(
            m_audioEngine->CreateSourceVoice(
            &implData->sourceVoice,
            format,
            0,
            XAUDIO2_DEFAULT_FREQ_RATIO,
            reinterpret_cast<IXAudio2VoiceCallback*>(&implData->callbackHander),
            nullptr,
            &chain
            )
            );

    #endif

    I hope they can get the arm target working.

    Another solution would be to downgrade to VS 2012 and use SDK 8.1


    Friday, April 11, 2014 3:40 PM

All replies

  • There was an issue with xapobase.lib in the Windows 8.0 SDK for ARM that was fixed for VS 2013 / Windows 8.1 SDK. Are you sure all your libraries are built with VS 2013?
    Friday, April 11, 2014 5:29 AM
  • I think the problem came back when they updated the _MSC_VER from 1700 to 1800. I'm not sure how to set the MSC version or what that is.  Maybe it's a Microsoft compiler version for native c++.  I can see that cl.exe produces a 1800 number for VS 12.0.

    c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin>cl.exe
    Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
    Copyright (C)Microsoft Corporation.  All rights reserved.

    From the wiki (http://en.wikipedia.org/wiki/Visual_C%2B%2B), Visual C++ 2013 (known also as Visual C++ 12.0) was released on October 17, 2013, and it is currently the latest stable release. It features further C++11 and C99 support and introduces a REST SDK.

    The project properties for Configuration:Release Platform:ARM, Configuration Properties->General->Target Platform Version is Windows 8.1

    Librarian->Additional Dependencies is XAPOBase.lib;%(AdditionalDependencies)

    After running the repair for Visual Studio under Control Panel->Programs and Features (took several hours).

    The C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\arm\xapobase.lib  still has the following text

    /FAILIFMISMATCH:"_MSC_VER=1700" /FAILIFMISMATCH:"_ITERATOR_DEBUG_LEVEL=0" /FAILIFMISMATCH:"RuntimeLibrary=MD_DynamicRelease" /FAILIFMISMATCH:"WIN_DETECT_STL_MISMATCH=110" /DEFAULTLIB:"msvcprt" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"

    The C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\arm\xapobase.lib

    /FAILIFMISMATCH:"_MSC_VER=1600" /FAILIFMISMATCH:"WIN_DETECT_STL_MISMATCH=100" /DEFAULTLIB:"msvcprt" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib"

    PS:  The project was created a couple weeks ago using File->New->Project... and then "Visual C++->Windows Store->Static Library (Windows Store apps)" wizard.

    I'm having trouble recreating the problem from scratch.  I'm going to keep adding pieces in from the broken project in to a fresh project to find what is causing the error.

    Ok recreated it.  You have to do the following on Visual Studio 2013:

    1. Create two projects: Static Library and Grid App (XAML) both with Visual C++ and .Net 4.5.1

    2.Add XAPOBase.lib to static lib.

    3. reference the static lib from Grid App and include ../StaticLibName in includes for Grid App.

    4. Implement XAPO (see http://msdn.microsoft.com/en-us/library/windows/desktop/ee415730%28v=vs.85%29.aspx)

    5. call new XAPO class from Grid App. 

        XAPO_REGISTRATION_PROPERTIES* reg = new XAPO_REGISTRATION_PROPERTIES();
        reg->MaxInputBufferCount = 1;
        reg->MinInputBufferCount = 0;
        reg->MaxOutputBufferCount = 1;
        reg->MinOutputBufferCount = 0;
        pXAPO = new TestLibXAPO(44100, reg);

    6. Compile for Release/ARM

    7. Get error message.


    Friday, April 11, 2014 1:30 PM
  • My workaround is to use a macro to prevent the code from being executed on ARM target.

    #if (_M_ARM)

        //
        // Create the source voice
        //
        DX::ThrowIfFailed(
            m_audioEngine->CreateSourceVoice(
            &implData->sourceVoice,
            format,
            0,
            XAUDIO2_DEFAULT_FREQ_RATIO,
            reinterpret_cast<IXAudio2VoiceCallback*>(&implData->callbackHander),
            nullptr,
            nullptr
            )
            );

    #else

        IUnknown* pXAPO;
        XAPO_REGISTRATION_PROPERTIES* reg = new XAPO_REGISTRATION_PROPERTIES();
        reg->MaxInputBufferCount = 1;
        reg->MinInputBufferCount = 0;
        reg->MaxOutputBufferCount = 1;
        reg->MinOutputBufferCount = 0;
        pXAPO = new TestLibXAPO(44100, reg);
        XAUDIO2_EFFECT_DESCRIPTOR descriptor;
        descriptor.InitialState = true;
        descriptor.OutputChannels = format->nChannels;
        descriptor.pEffect = pXAPO;
        XAUDIO2_EFFECT_CHAIN chain;
        chain.EffectCount = 1;
        chain.pEffectDescriptors = &descriptor;

        //
        // Create the source voice
        //
        DX::ThrowIfFailed(
            m_audioEngine->CreateSourceVoice(
            &implData->sourceVoice,
            format,
            0,
            XAUDIO2_DEFAULT_FREQ_RATIO,
            reinterpret_cast<IXAudio2VoiceCallback*>(&implData->callbackHander),
            nullptr,
            &chain
            )
            );

    #endif

    I hope they can get the arm target working.

    Another solution would be to downgrade to VS 2012 and use SDK 8.1


    Friday, April 11, 2014 3:40 PM
  • You can build your project with _ALLOW_MSC_VER_MISMATCH defined.
    Friday, April 11, 2014 8:04 PM
  • That did not doing anything.

    I tried putting it in pch.h

    #ifndef _ALLOW_MSC_VER_MISMATCH
    #define _ALLOW_MSC_VER_MISMATCH
    #endif

    Monday, April 14, 2014 1:40 PM
  • You should try adding it to the command-line (Preprocessor Definitions)

    Monday, April 14, 2014 6:26 PM
  • I added it to both projects for Release/ARM and did a clean and compile.  It still has the error.
    Monday, April 21, 2014 7:22 PM
  • That's unfortunate. The workaround had been able to resolve it with VS 2012/Windows 8.0 SDK.

    Tuesday, April 22, 2014 12:25 AM
  • I'm not able to repro this problem using VS 2013 Update 1 with ARM.

    Are you targeting Windows 8.1 or Windows 8?

    Tuesday, April 22, 2014 7:28 PM
  • Thanks for your continued investigation.  I like your dedication to helping solve my problem.

    I'm using VS2013 with Windows 8.1 Update 1 with ARM and Release selected.  You need to use the custom XAPO in the main program in order for the linker to trigger.  Note: there is no error if you don't use the custom XAPO class.

    See code in the else section of my work around for example of using the custom XAPO.  The code basically comes from the XAudio2 example in Windows 8.1 SDK. 

    There is no SDK example of a custom XAPO. So, see http://msdn.microsoft.com/en-us/library/windows/desktop/ee415730%28v=vs.85%29.aspx for making a custom XAPO class.

    I put a zipped up VS solution that shows the problem at http://support.dskow.com/oakstream/TestLib.zip (75kB)

    The TestLibXAPO class is defined in TestLib project and is called from App.xaml.cpp constructor  in TestGridApp project.

    If that zip does not reproduce the problem.  There must be something in your environment that is fixing it (a setting or a different lib or your using VS 2012).




    Wednesday, April 23, 2014 1:43 PM
  • The package manager install for DirectXTK : has error MSC_VER': value '1700' doesn't match value '1800" in Visual Studio 2013. I have a buildable version of the TK that can be added to my project though it would be nice to see stuff work without workarounds.

    Friday, June 6, 2014 12:00 AM
  • The NuGet package for DirectXTK is rather dated. You can obtain it directly from CodePlex.
    Friday, June 6, 2014 4:05 AM