ask for help pls
Page 1 of 1
Grine




Posts: 152

PostPosted: Tue, 15th Jan 2013 16:36    Post subject: ask for help pls
hi there!
im total newbe and have a problem.iv got Andre Lamothe book "tricks of windows game programming gurus" and when im compiling first example in this book ive got errors:

Warning 1 warning C4101: 'ps' : unreferenced local variable
Warning 2 warning C4101: 'hdc' : unreferenced local variable
Error 4 error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function "int __cdecl DD_Init(int,int,int)" (?DD_Init@@YAHHHH@Z)
Error 5 error LNK1120: 1 unresolved externals

and some more.but if go to project properties and change character set from Unicode to multibyte I end with errors 4 and 5 only.

now the book is from 2002 so the .cpp files and Im using visual studio 2012 express with windows 8 with directx sdk that comes with it.
I don't see ddraw.lib in sdk folder and don't know what to do and how to resolve the errors above
any help please will be appreciated
thank you
Back to top
[mrt]
[Admin] Code Monkey



Posts: 1338

PostPosted: Tue, 15th Jan 2013 16:56    Post subject:
Hey there,

Thats pretty dated stuff there. Coding aspect wise. The theory is still sound tho, so dont go binning the book Smile

When you try to compile the code you are missing a link to the dynamic library ddraw.lib, which links (or better, loads) to ddraw.dll. DirectDraw is a relic and was merged into Direct3D I think and hasn't existed since about DX7.

If you really want to get the thing to compile go search for the DX7 SDK. Simply unpack it and set the linkers 'Additional library paths' to the "<extracted DX7 dir>/lib" (as an example, its a similar name, browse around).

If you want it to run. Dunno if its even possible. Since vista DirectDraw support has been sketchy at best. I would probably go grab a Virtual machine like VirtualPC or VMWare and run XP with DX7 SDK. That would be the easiest.

Have a go. Post your progress.


teey
Back to top
BearishSun




Posts: 4484

PostPosted: Tue, 15th Jan 2013 17:00    Post subject:
You are missing the .lib file you mentioned but DirectDraw has been deprecated for a LONG time and is not included with DirectX SDK anymore.

You can try looking for older DirectX SDK but I seriously doubt you'll manage to run it on Win 8.

I suggest you find a newer version of the book, or a different book if possible. If you can switch to a different book let me know what you're interested in and I can list a few suggestions.

EDIT: Ninjaed Sad
Back to top
Grine




Posts: 152

PostPosted: Tue, 15th Jan 2013 17:05    Post subject:
thank you for your reply!
so I cant make any easy changes in code to run it with current directx sdk?
I have some experience with C\C++ but never worked with directx so I don't know what tot touch and if its possible at all to make such changes to code?
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Tue, 15th Jan 2013 17:06    Post subject:
Maybe as a starter you should look for something more robust and easy to start "game development"?

Ever looked at XNA and C#?


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Frant
King's Bounty



Posts: 24433
Location: Your Mom
PostPosted: Tue, 15th Jan 2013 17:08    Post subject:
C# is an excellent language to "start" in or even stay with. Obviously it's not optimal if you're planning on doing a huge game where performance is an issue but since it's managed you don't have to care about garbage collection and headers and stuff. Removes the tedious and messy stuff from programming.


Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!

"Thank you to God for making me an Atheist" - Ricky Gervais
Back to top
Grine




Posts: 152

PostPosted: Tue, 15th Jan 2013 17:11    Post subject:
BearishSun wrote:
You are missing the .lib file you mentioned but DirectDraw has been deprecated for a LONG time and is not included with DirectX SDK anymore.

You can try looking for older DirectX SDK but I seriously doubt you'll manage to run it on Win 8.

I suggest you find a newer version of the book, or a different book if possible. If you can switch to a different book let me know what you're interested in and I can list a few suggestions.

EDIT: Ninjaed Sad


I was searching a book about windows game programming.a book that is for total beginners in that area,with easy start.i founded this book very suitable.
but if you guys can recommend books suitable for my case ill appreciate.
I have not bad knowledge in C\C++ from academic course and that's it.so I need something for my case...
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Tue, 15th Jan 2013 17:13    Post subject:
Well, C# and XNA are really easy to get in to. And as frant said, managed languages are really good for beginners and especially with the help of the XNA framework you'll start with the actual developing much faster Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Frant
King's Bounty



Posts: 24433
Location: Your Mom
PostPosted: Tue, 15th Jan 2013 17:16    Post subject:
http://www.riemers.net/eng/Tutorials/DirectX/Csharp/series1.php


Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!

"Thank you to God for making me an Atheist" - Ricky Gervais
Back to top
BearishSun




Posts: 4484

PostPosted: Tue, 15th Jan 2013 17:24    Post subject:
Doing something like C# with XNA or Unity will certainly allow you to create a game much quicker, but building it from ground up with DirectX and C++ will give you a great insight of the inner workings of it all.

If you're already familiar with C++ I suggest you stick with it. Once you understand the low level workings of C++, it's easy to figure out C#.

Also most of the "heavy stuff" is done in C++, and majority of the literature uses it. In short, if you ever plan on going pro with game development you will most definitely need C++, so you can't go wrong with it.

----

To answer your question, there is no easy way do switch from direct draw to a newer method.

I can suggest you read:
Introduction to 3D Game Programming with Directx 11

And once you're familiar with the basics:
Practical Rendering and Computation with Direct3D 11

DirectX 9 is out of the door, and it uses so many obsolete techniques that you're gonna waste a lot of your time learning stuff that is no longer used. DirectX 11 is the way to go. Possibly OpenGL but OpenGL is missing a lot of DX11 features and in general DX11 is very nicely designed and easy to understand, yet powerful.
Back to top
Grine




Posts: 152

PostPosted: Tue, 15th Jan 2013 18:17    Post subject:
[quote="[mrt]"]Hey there,

Thats pretty dated stuff there. Coding aspect wise. The theory is still sound tho, so dont go binning the book Smile

When you try to compile the code you are missing a link to the dynamic library ddraw.lib, which links (or better, loads) to ddraw.dll. DirectDraw is a relic and was merged into Direct3D I think and hasn't existed since about DX7.

If you really want to get the thing to compile go search for the DX7 SDK. Simply unpack it and set the linkers 'Additional library paths' to the "<extracted DX7 dir>/lib" (as an example, its a similar name, browse around).
ok thanks ill try another most recent book but anyway I want to run that example code.
tell me please how exectly I set "additional library paths" to directx sdk folder.i found that option in project configurations but have trouble with it.what exectly I write in command line for "additional library paths".
my sdk path is
F:\downloads\soft
Back to top
BearishSun




Posts: 4484

PostPosted: Tue, 15th Jan 2013 20:38    Post subject:
Add a path to whatever folder the ddraw.lib is located in. With newer SDK the library folder is usually sdkpath/Lib/x86

(Replace x86 with x64 if building 64bit)

So for example (on my PC):
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group