#### Archived

This topic is now archived and is closed to further replies.

# Can't Link w/ DX9 - Help!

This topic is 5672 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''ve tried running just about every tutorial I can find (particularly those that come with DX9), and I keep getting this error (or something like it) when I try to build the project. I''ve added the library and header files, and bumped the up to #1 on the lists - there must be something I''m missing. Ideas? Linking... CreateDevice.obj : error LNK2001: unresolved external symbol _Direct3DCreate9@4 LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol_main Debug/CreateDevice.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe Also, I prefer to use Bloodshed''s Dev-C++ than Visual C++. Anyone successfully compiling DX9 with Dev-C++ please tell me how ;p Thanks, - carb

##### Share on other sites
Are you defining #define INITGUID after the headers. In your linker options are you setting it /subsystem: windows
Generally check though the linker options to see if u have the right options

##### Share on other sites
you need to make a win32 application and not a win32 console application

and you just need to add

#pragma comment(lib, "d3d9.lib"#pragma comment(lib, "d3dx9.lib"

to one of your .cpp files in the project

##### Share on other sites
Yeah, uh, none of that works.

Yes, its a Windows Application.

##### Share on other sites
You might try the DirectX 9 AppWizard from within the Visuall C IDE usually when you type new from your File section its under projects.

I tried the teapot example sort of like the old C/C++ hello world. It did compile and link in the DX9 lib and ran ok.

Might be a good example you can look at so you can determine why your program is not compiling and linking the DX9 librarys or you could use the code thats generated as staring point to get a working program up and running.

Just a thought.

Doug

##### Share on other sites
I suppose I didn''t link the files explicitly in the project settings e.g. C:\DXSDK\Lib\*.lib ... So now I know how to do it with Visual C++, but what about the Bloodshed compiler? Anyone here writing DX apps with Dev-C/C++?

- carb

1. 1
2. 2
JoeJ
20
3. 3
4. 4
frob
12
5. 5

• 13
• 18
• 13
• 20
• 13
• ### Forum Statistics

• Total Topics
632194
• Total Posts
3004681

×