Error Lnk2019 Direct3dcreate9 @4
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
Idirect3d9
about Stack Overflow the company Business Learn more about hiring developers or posting visual studio link library ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How do I solve LNK2019 for Direct3DCreate9? up vote 2 down vote favorite During compile time I get the following error: RAT_RendererDX9.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "public: void __thiscall RAT_ENGINE::RAT_RendererDX9::Init(class RAT_ENGINE::RAT_WindowManager *)" (?Init@RAT_RendererDX9@RAT_ENGINE@@QAEXPAVRAT_WindowManager@2@@Z) The only place that I use Direct3DCreate9 is in my Init() function of the Renderer which has the following code: void RAT_RendererDX9::Init(RAT_WindowManager* argWMan) { wMan = argWMan; g_pD3D = (LPDIRECT3D9)Direct3DCreate9( D3D_SDK_VERSION ); D3DPRESENT_PARAMETERS d3dpp; ZeroMemory( &d3dpp, sizeof( d3dpp ) ); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pd3dDevice ); } Where does this error come from and how can I solve it? I've tried the other answers to LNK2019, but they didn't resolve my problem. c++ visual-c++ directx directx-9 share|improve this question edited Feb 3 '13 at 0:03 GSerg 47.9k775128 asked Feb 3 '13 at 0:01 Friso1990 364421 You need to link in the directx library. –Alexey Frunze Feb 3 '13 at 0:08 5 Add d3d9.lib to the linker's additional dependencies. –Hans Passant Feb 3 '13 at 0:10 I've already used #include
topic ForumsMembersHelp Files Developer Journals Gallery Calendar Downloads Resources Store Classifieds Tracker Links Home For Beginners Articles All Articles Post an Article Technical Game Programming General Programming Graphics Programming and Theory DirectX and XNA OpenGL and Vulkan Multiplayer and Network Programming Artificial Intelligence Math and Physics Mobile Development Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design Music and Sound Visual Arts Business Breaking into the Industry Production and Management Interviews Business and Law Event Coverage Forums All Forums Technical Game Programming General Programming Graphics Programming and Theory DirectX and XNA OpenGL & Vulkan Multiplayer and Network Programming Artificial Intelligence Math and Physics Mobile & Console Development http://stackoverflow.com/questions/14667945/how-do-i-solve-lnk2019-for-direct3dcreate9 Build Systems & Source Control Middleware, Libraries, and Tools Virtual and Augmented Reality Creative Game Design Writing For Games Music and Sound Visual Arts Gallery Business Breaking into the Industry Business & Law Production & Management Community GDNet Lounge Coding Horrors Article Writing Comments, Suggestions and Ideas Your Announcements Hobby Project Classifieds Indie Project Showcase Community Developer Journals GDNet+ Subscriptions Gallery Store Classifieds Jobs Freelancers Hobby Projects Marketplace Newsletter » Home » Forums » http://www.gamedev.net/topic/527322-unresolved-external-symbol-_direct3dcreate94/ The Technical Side » DirectX and XNA Chat Watched Content New Content 0 unresolved external symbol _Direct3DCreate9@4 Started by Andy474, Mar 09 2009 08:25 AM Old topic! Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic. This topic is locked 15 replies to this topic #1 Andy474 Members -Reputation: 690 Like 0Likes Like Posted 09 March 2009 - 08:25 AM HI there, im fairly new to DirectX3D and there are many topics similar to this, alas, i cant find and answer - I am using the example code in the Direct X SDK
Programming Boards C++ Programming directx sdk samples not working Getting started with C or C++ | C Tutorial | C++ Tutorial http://cboard.cprogramming.com/cplusplus-programming/127827-directx-sdk-samples-not-working-2.html | C and C++ FAQ | Get a compiler | Fixes for common problems Thread: directx sdk samples not working Thread Tools Show Printable Version Email this Page… Subscribe to this http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1045714410 Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 06-29-2010 #16 spencerjack View Profile View Forum Posts Registered User Join Date May 2010 Posts 28 Okay. Yes, I error lnk2019 see it. DXSETUP.exe Installed with no problems. I'll go ahead and try to run my proggie and see what happens. 06-29-2010 #17 spencerjack View Profile View Forum Posts Registered User Join Date May 2010 Posts 28 And here are my errors, 1>------ Build started: Project: autodidac_dx_2, Configuration: Debug Win32 ------ 1> prog.cpp 1>prog.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in error lnk2019 direct3dcreate9 function "void __cdecl initD3D(struct HWND__ *)" (?initD3D@@YAXPAUHWND__@@@Z) 1>prog.obj : error LNK2019: unresolved external symbol _D3DXMatrixPerspectiveFovLH@20 referenced in function "void __cdecl render_frame(void)" (?render_frame@@YAXXZ) 1>prog.obj : error LNK2019: unresolved external symbol _D3DXMatrixLookAtLH@16 referenced in function "void __cdecl render_frame(void)" (?render_frame@@YAXXZ) 1>prog.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationY@8 referenced in function "void __cdecl render_frame(void)" (?render_frame@@YAXXZ) 1>C:\Documents and Settings\Rian Saville\My Documents\Visual Studio 2010\Projects\autodidac_dx_2\Debug\autodidac_dx_2. exe : fatal error LNK1120: 4 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== Could this be because I didn't install the symbol files? 06-29-2010 #18 VirtualAce View Profile View Forum Posts Super Moderator Join Date Aug 2001 Posts 9,608 No that is b/c you aren't linking with the export libraries. You will need to add these lines for your linker. d3d9.lib d3dx9.lib (release) or d3dx9d.lib (debug) dxguid.lib (this has all the GUIDs for the interfaces) For MSVC you add those lines in Linker->Input->Additional Dependencies Direct3DCreate9() is in d3d9.lib All the other unresolved externals you are getting are in d3dx9.lib and d3dx9d.lib If you are linking with the debug version of D3DX (d3dx9d.lib) you should also define D3D_DEBUG_INFO in your pre-processo
専門家 企業公式 Q&A一覧 回答コーナー 今すぐ利用登録 Q&A 知恵ノート Q&A Q&A 知恵ノート 条件指定 すべてのカテゴリ C言語関連 質問・相談 知恵ノートを書く 知恵袋トップ> コンピュータテクノロジー> プログラミング> C言語関連 現在JavaScriptが無効になっています。 Yahoo!知恵袋のすべての機能を利用するためには、javaScriptの設定を有効にしてください。 JavaScriptの設定を変更するには「JavaScriptの設定方法」をご覧ください。 ビルド時に「error LNK2019: 未解決の外部シンボル _Direct3DCreate9@4」というエ... シェア ツイート はてブ 知恵コレ yh_propさん 2010/8/2218:28:42 ビルド時に「error LNK2019: 未解決の外部シンボル _Direct3DCreate9@4」というエラーが出てしまいます。 Visual C++ 2010 Express Edition、DirectX 9.0 SDK (October 2004)をインストールしています。 Direct3DCreate9の呼び出し箇所が原因だと思いますが、対処方法が全く分かりません。 ネットで色々調べると、ディレクトリの指定に関することばかりなのですが、下記の指定に誤りがあるのでしょうか? 気になったのが、Libフォルダの中には、d3d9.lib等のLIBファイルとx64フォルダがあり、x86フォルダがありませんでした。 <インクルードディレクトリ> C:\Program Files\Microsoft DirectX 9.0 SDK %28October 2004%29\Include; <ライブラリ ディレクトリ> C:\Program Files\Microsoft DirectX 9.0 SDK %28October 2004%29\Lib\; 共感した 0 閲覧数:5,002 回答数:1 お礼:25枚 違反報告 ベストアンサーに選ばれた回答 ID非公開さん 2010/8/2220:19:22 リンカに依存ファイルを指定しましたか? 意味が分からなければ補足してください。 ナイス 2 違反報告 質問した人からのコメント 2010/8/2222:55:14 プロジェクトのプロパティ→「構成プロパティ」→「リンカー」→「入力」→「追加の依存