🔒 Locked
getting directx to work on dev-cpp
Advertisement
Original Post
Quote:
Original post by 2122
What's a devpack?
Look here.
Also, Dev-C++ hasn't been updated for 17 months (version 5 is still beta since Feb. 2005). It might be discontinued or at least put on ice. I'd suggest looking at Code::Blocks and trying that out, too. Maybe you'll like it even better than Dev-C++.
Good luck!
Quote:
Original post by 2122
I've looked in the faq, and searched the forums, but I can't find out how to fix the linker error I get when I try to compile one of the directx sample programs that came with the book. It says "undefined reference to 'direct3dcreate9@4'" what do I do about this?
The DirectX SDK provides libraries in the new lib format. Perhaps MinGW GCC (which DevCPP uses) hasn't supported it yet. Check this article.
This is what you need to install. Not too sure what it was that you found.
That's the web install. There is also a full download if you're inclined. Alternatively you can also buy the CD but it's not necessary.
Once that's installed you need to change a few things in some script, but it's been so long that I can't remember the specifics. A quick Google search helped me on that one.
That's the web install. There is also a full download if you're inclined. Alternatively you can also buy the CD but it's not necessary.
Once that's installed you need to change a few things in some script, but it's been so long that I can't remember the specifics. A quick Google search helped me on that one.
I got the SDK and followed the instructions for setting it up, and tried the program that opens a blank window. I get three error when I try to build it.
error C2731: 'WinMain' : function cannot be overloaded
error C2440: '=' : cannot convert from 'const char [15]' to 'LPCWSTR'
error C2664: 'CreateWindowExW' : cannot conver parameter 2 from 'const char [15]' to 'LPCWSTR'
This is on the visual c++ compiler.
error C2731: 'WinMain' : function cannot be overloaded
error C2440: '=' : cannot convert from 'const char [15]' to 'LPCWSTR'
error C2664: 'CreateWindowExW' : cannot conver parameter 2 from 'const char [15]' to 'LPCWSTR'
This is on the visual c++ compiler.
Sometimes that happens for me, so I just cast the string to an LPCWSTR and it works fine.
For the WinMain error, was the did you select the Windows Application option when you made your Win32 project? So far that's the only explanation that I can think of at the moment, unless you gave the wrong arguments to the WinMain function or something.
For the WinMain error, was the did you select the Windows Application option when you made your Win32 project? So far that's the only explanation that I can think of at the moment, unless you gave the wrong arguments to the WinMain function or something.
After you install the Platform SDK you need to remove a couple of comments from some script, enabling the Win32 windowed option in the application settings (when you first make your project). The code from your book should be fine as is.
Casting every string (or at least the ones that gave errors) to an LPCWSTR should keep the compiler happy. I can't remember if it was Unicode or Multibyte that didn't need a cast.
Casting every string (or at least the ones that gave errors) to an LPCWSTR should keep the compiler happy. I can't remember if it was Unicode or Multibyte that didn't need a cast.
I got the window application to work. It makes an empty window just like the program I got from the book, but it's code is alot different, it doesn't even use the same include files or anything, and it has a bunch of resource files. Is that the way it's supposed to be?
Edit:
I got it to work with the code from my book too. Now that that's set I'm going to try to set up the directx stuff too. I think the book has instructions for this.
[Edited by - 2122 on July 10, 2006 3:09:02 PM]
Edit:
I got it to work with the code from my book too. Now that that's set I'm going to try to set up the directx stuff too. I think the book has instructions for this.
[Edited by - 2122 on July 10, 2006 3:09:02 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement