943,867 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 4346
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
May 13th, 2009
0

Including DDRAW.LIB | H into a project

Expand Post »
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.
Similar Threads
Reputation Points: 12
Solved Threads: 6
Junior Poster in Training
ShadowScripter is offline Offline
94 posts
since Apr 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

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.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

@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.
Reputation Points: 47
Solved Threads: 69
Posting Whiz
cikara21 is offline Offline
340 posts
since Jul 2008
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

Click to Expand / Collapse  Quote originally posted by cikara21 ...
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.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

Quote ...
After a bit of Googling
Quote ...
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.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

Click to Expand / Collapse  Quote originally posted by tux4life ...
Hope this helps
Already did that, but nothing changed. It still won't compile. Any more suggestions?
Reputation Points: 12
Solved Threads: 6
Junior Poster in Training
ShadowScripter is offline Offline
94 posts
since Apr 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

Already did that, but nothing changed. It still won't compile. Any more suggestions?
Yes, are you compiling it as a Windows Executable?
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

It's a debug compilation, if that means anything. Otherwise, I doubt it has anything to do with the problem
Reputation Points: 12
Solved Threads: 6
Junior Poster in Training
ShadowScripter is offline Offline
94 posts
since Apr 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

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.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009
May 13th, 2009
0

Re: Including DDRAW.LIB | H into a project

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.
Reputation Points: 12
Solved Threads: 6
Junior Poster in Training
ShadowScripter is offline Offline
94 posts
since Apr 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Need help with understanding some functions
Next Thread in C++ Forum Timeline: Ogg to Avi converter!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC