Including DDRAW.LIB | H into a project

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Apr 2009
Posts: 52
Reputation: ShadowScripter is an unknown quantity at this point 
Solved Threads: 0
ShadowScripter's Avatar
ShadowScripter ShadowScripter is offline Offline
Junior Poster in Training

Including DDRAW.LIB | H into a project

 
0
  #1
May 13th, 2009
Hey, I've been trying to understand what the hell I'm doing wrong with this code.
At the beginning, I include the DDRAW.H, and the code compiles with no problem, but as soon as I try using a function from that header, I get a linker error.

The function I used was the DirectDrawCreate(NULL, &lpDD, NULL)
And it's the only function I used, before I typed it in it compiled.
(I also made a global pointer, but that too compiled before adding this function)

Error message:
"error LNK2019: unresolved external symbol _DirectDrawCreate@12 referenced in function..."

I'm assuming this error is because the library file hasn't been included somehow into the project? Anyone know what to do?
Tutorials on the subject? Anything that might help me understand how to work with VC++'s linker

I've added the library directory to the linker, I've added the specific library to the linker, and still nothing.
Last edited by ShadowScripter; May 13th, 2009 at 3:10 pm.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: Including DDRAW.LIB | H into a project

 
0
  #2
May 13th, 2009
Try to pass the following arguments to your compiler: /EHsc /link YourLib.lib

Edit:: Maybe this is also helpful ...
Last edited by tux4life; May 13th, 2009 at 3:21 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: Including DDRAW.LIB | H into a project

 
0
  #3
May 13th, 2009
@tux
Sorry dude..

Where did you get that lib..
Try this..
Project | Add Existing Item..Then add DDRAW.H into your project..
Last edited by cikara21; May 13th, 2009 at 3:27 pm.
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: Including DDRAW.LIB | H into a project

 
0
  #4
May 13th, 2009
Originally Posted by cikara21 View Post
Where did you get that lib..
Actually DDRAW.LIB is part of DirectX SDK
Last edited by tux4life; May 13th, 2009 at 3:31 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: Including DDRAW.LIB | H into a project

 
0
  #5
May 13th, 2009
After a bit of Googling
Just go to project properties -> Configuration properties -> Linker.
Go to -> General and set the "Additional Library directories" to point to your lib file directory.

Then go to Linker -> Input and type in your lib file name DDRAW.LIB in the "Additional Dependencies" field.
Hope this helps
Last edited by tux4life; May 13th, 2009 at 3:40 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 52
Reputation: ShadowScripter is an unknown quantity at this point 
Solved Threads: 0
ShadowScripter's Avatar
ShadowScripter ShadowScripter is offline Offline
Junior Poster in Training

Re: Including DDRAW.LIB | H into a project

 
0
  #6
May 13th, 2009
Originally Posted by tux4life View Post
Hope this helps
Already did that, but nothing changed. It still won't compile. Any more suggestions?
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: Including DDRAW.LIB | H into a project

 
0
  #7
May 13th, 2009
Originally Posted by ShadowScripter View Post
Already did that, but nothing changed. It still won't compile. Any more suggestions?
Yes, are you compiling it as a Windows Executable?
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 52
Reputation: ShadowScripter is an unknown quantity at this point 
Solved Threads: 0
ShadowScripter's Avatar
ShadowScripter ShadowScripter is offline Offline
Junior Poster in Training

Re: Including DDRAW.LIB | H into a project

 
0
  #8
May 13th, 2009
It's a debug compilation, if that means anything. Otherwise, I doubt it has anything to do with the problem
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: Including DDRAW.LIB | H into a project

 
0
  #9
May 13th, 2009
Originally Posted by ShadowScripter View Post
It's a debug compilation, if that means anything. Otherwise, I doubt it has anything to do with the problem
You just have to make sure that you compile DirectX programs as a Windows Executable
Last edited by tux4life; May 13th, 2009 at 3:57 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 52
Reputation: ShadowScripter is an unknown quantity at this point 
Solved Threads: 0
ShadowScripter's Avatar
ShadowScripter ShadowScripter is offline Offline
Junior Poster in Training

Re: Including DDRAW.LIB | H into a project

 
0
  #10
May 13th, 2009
Hm, I'm really new to this, and I assumed that everytime you build a solution, it creates an executable?

How do I make sure it compiles as an exe?
Last edited by ShadowScripter; May 13th, 2009 at 3:59 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC