3

概要:リリース バージョンのコンパイル時に宣言されていない識別子SetDefaultDllDirectoriesfromatlcore.hが報告されますが、デバッグのコンパイル時には問題ありません。さらに調査すると、_USING_V110_SDK71_がその役割を果たしていることがわかります。これはプロジェクトの既定値から継承する必要があります (下の図を参照)。

詳細: C++ ネイティブの ATL アプリケーションを Visual C++ 2005 から Visual C++ 2015 に移行しています。目標は、Windows XP の実行バージョンをできるだけ長く維持することです。そのため、v140_xp プラットフォーム ツールセットがプロジェクトに設定されました。Debug バージョンでは問題なく動作します。ただし、Release MinDepency バージョンのコンパイル エラーが発生します。v140 (_xp なし) を使用すると、正常にコンパイルされます。

これは、移行する必要があるアプリケーションのブランチです。他のブランチ (以前) を VC++ 2008、2010、2012、および 2013 に正常に移行しました。

他の場所でも言及されているエラーを見てきました。ただし、理由は異なる場合があります。完全なエラー行は次のとおりです。

1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlcore.h(644):
error C2065: 'SetDefaultDllDirectories':undeclared identifier

問題のある行は、次の場合に使用されます。

#ifndef _USING_V110_SDK71_

したがって、明らかにそのシンボルは定義されていませんでした。Visual Studio 2015 Professional、バージョン 14.0.23107.0 D14REL、および Windows 8.1 を使用しています。

プロジェクト設定を確認するときは、_USING_V110_SDK71_プロジェクトのデフォルトから継承されたシンボルを定義する必要があります。

_USING_V110_SDK71_ を定義する必要があります!?

更新:エラー メッセージと [出力] ウィンドウの周りの行:

1>------ Build started: Project: Market, Configuration: Release MinDependency Win32 ------
1>  SplashScreen.cpp
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\sal_supp.h(57): warning C4005: '__useHeader': macro redefinition
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\sal.h(2886): note: see previous definition of '__useHeader'
1>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\specstrings_supp.h(77): warning C4005: '__on_failure': macro redefinition
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\sal.h(2896): note: see previous definition of '__on_failure'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlcore.h(644): error C2039: 'SetDefaultDllDirectories': is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlcore.h(644): error C2065: 'SetDefaultDllDirectories': undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\atlcore.h(646): error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32': undeclared identifier
1>c:\program files (x86)\microsoft visual studio 14.0\vc\wtl90\include\atlgdi.h(470): warning C4838: conversion from 'int' to 'UINT' requires a narrowing conversion
1>c:\program files (x86)\microsoft visual studio 14.0\vc\wtl90\include\atlgdi.h(477): warning C4838: conversion from 'int' to 'UINT' requires a narrowing conversion
1>c:\program files (x86)\microsoft visual studio 14.0\vc\wtl90\include\atlgdi.h(484): warning C4838: conversion from 'int' to 'UINT' requires a narrowing conversion
1>c:\program files (x86)\microsoft visual studio 14.0\vc\wtl90\include\atlgdi.h(491): warning C4838: conversion from 'int' to 'UINT' requires a narrowing conversion
1>c:\program files (x86)\microsoft visual studio 14.0\vc\wtl90\include\atlgdi.h(3683): warning C4838: conversion from 'LONG' to 'DWORD' requires a narrowing conversion
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

あなたはそれについていくつかの光を当てることができますか?ありがとう

4

1 に答える 1

3

以前のバージョンの Visual Studio からプロジェクト ファイルを変換した場合、一部のビルド設定 (プリプロセッサ マクロ定義を含む) が個々のファイルの構成設定に出力された可能性があります。これを確認するには、ソース ファイルを右クリックして [プロパティ] をクリックし、[プリプロセッサ] タブに移動します。[プリプロセッサの定義] フィールドに太字のテキストが表示されている場合は、これが原因であることがわかります。これを修正するには、各ファイルにプロジェクト設定を継承させる必要がありますが、これは面倒な場合があります。テキスト エディタで vcxproj をロードし、問題のある定義を削除するのが最も簡単だと思います。

于 2015-11-03T04:19:02.983 に答える