directX9について

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
xj0461

directX9について

#1

投稿記事 by xj0461 » 8年前

お世話になっております。
VS2010でビルド&コンパイル確認済みのdirectX9を使用したプログラムなのですが、vs2015でビルド&コンパイルするとリンカエラーなどが出てきてしまいコンパイルが通らないのですが解決方法は有りますでしょうか?

アバター
tk-xleader
記事: 158
登録日時: 13年前
連絡を取る:

Re: directX9について

#2

投稿記事 by tk-xleader » 8年前

 DirectXについてはほとんど回答できないのですが…
 少なくともエラーメッセージを書いていただかないと、誰も答えようがないと思います。ただ、可能性として考えられるのは、

・SDL(Secure Development Lifesycle)の厳格化。
・外部ライブラリの静的バイナリがVS2010でコンパイルされていて、バイナリ互換性が失われている。

などが考えられますが、エラーメッセージを記述しなければ何ともいえません。

xj0461

Re: directX9について

#3

投稿記事 by xj0461 » 8年前

返信ありがとうございます。
エラー内容は以下の通りになります。

ビルド実行
出力欄
出力元 ビルド
-------------------------------------------------------------------------------------------------------
1>------ ビルド開始: プロジェクト:GameAction2_17, 構成:Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(936,5): warning MSB8027: Two or more files with the name of MyGame.cpp will produce outputs to the same location. This can lead to an incorrect build result. The files involved are GameFrame\MyGame.cpp, MyGame.cpp.
1> MyUtility.cpp
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(101): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(101): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(108): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(108): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(111): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(111): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(114): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(114): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(124): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(124): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(127): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(127): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(130): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(130): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(140): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(140): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(145): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(145): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(150): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(150): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(155): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(155): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(160): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(160): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(165): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(165): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(170): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(170): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(175): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(175): note: 引数リスト '(float)' を一致させようとしているとき
1>c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(180): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp(180): note: 引数リスト '(float)' を一致させようとしているとき
1> DXUTenum.cpp
1>c:\users\ushiyama hironari\desktop\gameaction2_17\dxut\core\dxutenum.cpp(3976): error C2668: 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照)
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(359): note: '__int64 abs(const __int64) throw()' の可能性があります
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(354): note: または 'long abs(const long) throw()'
1> c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdlib.h(284): note: または 'int abs(int)'
1> c:\users\ushiyama hironari\desktop\gameaction2_17\dxut\core\dxutenum.cpp(3976): note: 引数リスト '(float)' を一致させようとしているとき
1> コードを生成中...
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========

-------------------------------------------------------------------------------------------------------

エラー一覧
-------------------------------------------------------------------------------------------------------
重大度レベル コード 説明 プロジェクト ファイル 行 抑制状態
警告 MSB8027 Two or more files with the name of MyGame.cpp will produce outputs to the same location. This can lead to an incorrect build result. The files involved are GameFrame\MyGame.cpp, MyGame.cpp. GameAction2_17 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets 936
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 101
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 108
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 111
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 114
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 124
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 127
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 130
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 140
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 145
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 150
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 155
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 160
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 165
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 170
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 175
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\gamelibrary\myutility.cpp 180
エラー C2668 'abs': オーバーロード関数の呼び出しを解決することができません。(新機能 ; ヘルプを参照) GameAction2_17 c:\users\ushiyama hironari\desktop\gameaction2_17\dxut\core\dxutenum.cpp 3976

-------------------------------------------------------------------------------------------------------

です。分かりますでしょうか?

アバター
tk-xleader
記事: 158
登録日時: 13年前
連絡を取る:

Re: directX9について

#4

投稿記事 by tk-xleader » 8年前

 おそらくなのですが、std::abs関数をdoubleあるいはfloat型の実引数で呼び出しているであろう箇所がいくつかあるにもかかわらず、<cmath>がincludeされていないということが原因でしょう。この場合、整数型に対するstd::absしか宣言されていないため、コンパイラはオーバーロードされたstd::absの解決にあたって、double(or float)→int,const long,const long longの変換を試みようとします。
 しかし、このいずれの変換も実数型→整数型の縮小変換という意味では同等なので、コンパイラはいずれのオーバーロード関数にも優劣を決定できないため、「関数呼び出しがあいまいである」というエラーを吐き出したものだと思います。

 よって、考えられる解決策の1つとして、abs(std::abs)を呼び出している.cppファイルで<cmath>をインクルードすることが挙げられます。

xj0461jr

Re: directX9について

#5

投稿記事 by xj0461jr » 8年前

返信ありがとうございます。
cmathを追加しましたがまたしてもエラーが出てしまいます。

-----------------------------------------------------------------------------
1>------ ビルド開始: プロジェクト:GameAction2_17, 構成:Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(936,5): warning MSB8027: Two or more files with the name of MyGame.cpp will produce outputs to the same location. This can lead to an incorrect build result. The files involved are GameFrame\MyGame.cpp, MyGame.cpp.
1> DXUTenum.cpp
1>Debug\MyGame.obj : warning LNK4042: オブジェクトの指定が重複しています。余分なものは無視されます。
1>DXUT.obj : error LNK2019: 未解決の外部シンボル __imp__InitCommonControls@0 が関数 "long __stdcall DXUTInit(bool,bool,wchar_t *,bool)" (?DXUTInit@@YGJ_N0PA_W0@Z) で参照されました。
1>dxerr.lib(dxerrw.obj) : error LNK2019: 未解決の外部シンボル __vsnwprintf が関数 "long __stdcall StringVPrintfWorkerW(unsigned short *,unsigned int,unsigned int *,unsigned short const *,char *)" (?StringVPrintfWorkerW@@YGJPAGIPAIPBGPAD@Z) で参照されました。
1>C:\Users\Ushiyama Hironari\Desktop\GameAction2_17\Debug\GameAction2_17.exe : fatal error LNK1120: 2 件の未解決の外部参照
========== ビルド: 0 正常終了、1 失敗、0 更新不要、0 スキップ ==========

-----------------------------------------------------------------------------

--------------------------------------------------------------------------------
重大度レベル コード 説明 プロジェクト ファイル 行 抑制状態
警告 MSB8027 Two or more files with the name of MyGame.cpp will produce outputs to the same location. This can lead to an incorrect build result. The files involved are GameFrame\MyGame.cpp, MyGame.cpp. GameAction2_17 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets 936
警告 LNK4042 オブジェクトの指定が重複しています。余分なものは無視されます。 GameAction2_17 C:\Users\Ushiyama Hironari\Desktop\GameAction2_17\Debug\MyGame.obj 1
エラー LNK2019 未解決の外部シンボル __imp__InitCommonControls@0 が関数 "long __stdcall DXUTInit(bool,bool,wchar_t *,bool)" (?DXUTInit@@YGJ_N0PA_W0@Z) で参照されました。 GameAction2_17 C:\Users\Ushiyama Hironari\Desktop\GameAction2_17\DXUT.obj 1
エラー LNK2019 未解決の外部シンボル __vsnwprintf が関数 "long __stdcall StringVPrintfWorkerW(unsigned short *,unsigned int,unsigned int *,unsigned short const *,char *)" (?StringVPrintfWorkerW@@YGJPAGIPAIPBGPAD@Z) で参照されました。 GameAction2_17 C:\Users\Ushiyama Hironari\Desktop\GameAction2_17\dxerr.lib(dxerrw.obj) 1
エラー LNK1120 2 件の未解決の外部参照 GameAction2_17 C:\Users\Ushiyama Hironari\Desktop\GameAction2_17\Debug\GameAction2_17.exe 1

--------------------------------------------------------------------------------

これは何が原因でしょうか?

アバター
tk-xleader
記事: 158
登録日時: 13年前
連絡を取る:

Re: directX9について

#6

投稿記事 by tk-xleader » 8年前

 エラーはいずれも「リンク時に必要な関数が存在していない」という内容で、足りない外部関数はいずれもVCに存在しているはずのものなので、プロジェクトの設定を変更して追加のライブラリを指定すればいいはずです。

(1) InitCommonControls関数はComctl32.libにあるので、これを追加すればいいでしょう。
(2) __vsnwprintf関数は、VS2015から別のライブラリに移されたらしく([anchor=note0 goto=note1]*1[/anchor])、あらたにlegacy_stdio_definitions.libをリンカに渡さなければならないようです。

 それと、プロジェクト内の別フォルダに同じ名前のソースファイルが存在しているようですが、これは直したほうがいいのではないでしょうか。別の問題を引き起こす種になりそうです。

[anchor=note1]*1[/anchor] 参照:Updated to VS 2015 and now get Unresolved External Errors

xj0461jr

Re: directX9について

#7

投稿記事 by xj0461jr » 8年前

無事にビルド&コンパイルが通りました。
vs2015では, 色々なところが変わっていて難しいですね。
ご教授ありがとう御座いました。

閉鎖

“C言語何でも質問掲示板” へ戻る