Public Group

#### Archived

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

# Dev-Cpp w/ DX

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

## Recommended Posts

I''m using the free Dev-Cpp compiler and have mostly enjoyed it, but when I tried to code a simple DirectDraw program it gave me several errors. I got rid of all the obvious errors, but two won''t go away. I #include <ddraw.h> and linked to ddraw.lib, but it won''t compile. Ive been using the code for a while and it was recently part of a working but very simple windows program. I checked ddraw.h and it contains line DEFINE_GUID(IID_IDirectDraw7,0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b); and, of course, I can''t check the contents of ddraw.lib, but I found the info on an article here. It just won''t compile. [Linker error] undefined reference to IID_IDirectDraw7'' [Linker error] undefined reference to DirectDrawCreateEx@16''

##### Share on other sites
I had a similar problem with DDraw a couple of years ago when I was playing around with it, using VC++6. I managed to solve it by removing the ddraw libraries from the project and re-adding them :-/ Don''t know why it worked though, and I guess it''s not very likely to work for you.

Harry.

##### Share on other sites
Dev-Cpp uses the MinGW compiler as a backend, which is the windows version of the Linux GCC compiler. That is, Dev-Dpp isn''t a compiler, it''s just an IDE.

The DX libraries that come with the SDK are for Micrsoft''s compiler (of course) and can''t be read natively by MinGW. You need to get the Dev-Cpp ports. If you''re using one of the version 5 Beta''s, just use vUpdate to grab the library package. If not, grab them from here. (it''s the DirectX 8 package.)

Also, you may need to grab the latter ones anyway since the DirectInput libs from the vUpdate didn''t seem to work. If you''re not using DInput, don''t worry about it.

"The sun is the same in a relative way,
but you''re older"
--Pink Floyd

##### Share on other sites
Nope, sorry. I had a problem like this when I tried to use OpenGL, too. I got it by fooling around with it, but I can''t do it again. Both glad and sad to find that it isn''t just my compiler. I have no idea what to do.

##### Share on other sites
Posted that message before I saw yours. Thanks, I''ll try it.

##### Share on other sites
well here is how you can get it to work. If you are using the dx sdk then uninstall it or use it for examples but do not use its libs. Instead if you aren't using it then use the vupdate tool that it comes with and get the dx9.0 package and install that. Now instead of linking ddraw.lib you need to link libddraw.a which is easy because all you need to do is put -lddraw in linker options.

oh and since I was beaten to the answer I'll add this tidbit- all that is missing from the dinput in the minGW version is a few const variables so all you need to get that to work is link both the minGW version and microsoft's. beleave me I had quite a headache after figuring that out =-)

[edited by - Yohumbus on April 17, 2003 11:28:38 PM]

##### Share on other sites
I recently updated to the beta. I ran vUpdate and it went from x.xx6 to x.xx7, but it won''t work. I couldn''t find anything else on vUpdate. I did link to Dev-Cpp''s ddraw lib instead of Microsoft''s, but I''m still using MS''s ddraw.h. I''ll try to find a GCC/MingW ddraw.h, though.

##### Share on other sites
It still isn''t working! I am using Dev-Cpp''s lib and header and it has the same errors. I would have thought that I had made an error, but the included DirectX test didn''t compile, either. Oh, and, by the way, I appreciate all of you more experienced people hanging around and giving advice. It really helps us. I am getting really frustrated, because everything using DirectX doesn''t seem to compile on my computer, even if its a sample that I didn''t write.

##### Share on other sites
which version of directx? Have you the correct headers and libraries installed?

[edited by - xaxa on April 17, 2003 12:16:19 AM]

##### Share on other sites
I has the Microsoft DX9 installed, but I switched to Dev-Cpp DX8 versions. Either way, its ahead of DirectDraw7, which I''m trying to use. I had Microsoft''s installed fully, and with the Dev-Cpp versions I linked them in to the compiler directories. Its hard to make a mistake: Include to Include, Lib to Lib, etc.

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633722
• Total Posts
3013549
×