Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Magmai - thanks!!!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 February 2002 - 03:44 PM

magmai, you''ve helped me out of a big jam. i had a major ... no, make that a MAJOR jr.-newbie-wet-behind-the-ears problem with a: Unresolved external ''DirectDrawCreateEx'' referenced from C:\MYSOURCE\SOURCE01.OBJ in some thread from dec 01 you recommended adding: #pragma comment(lib, "ddraw.lib") before my #include "ddraw.h" thanks, it worked! i''ve been stuck on this on for a wee ... er, a long time. i''m using borland''s free bcc32 compiler with win xp and dx8.0 any idea why this fix worked? (i''m so happy i''m writing grandmom a snail-mail next!) Sleep is for fools who never see the sun rise

Sponsor:

#2 zealouselixir   Members   -  Reputation: 237

Like
Likes
Like

Posted 12 February 2002 - 03:54 PM

Well, I suppose you haven''t been helped until you know why the solution works, so here goes.

the #pragma comment(lib, "filename.lib") preprocessor directive tells the compiler to link the file in at runtime. In your case, this was the directdraw static library. Until the time that you linked this file, your code was making references to an object that didn''t exist, namely the function DirectDrawCreateEx function.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[if you have a link proposal, email me.]

#3 kvh   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 February 2002 - 10:42 PM

Just keep in mind that pragma''s like this are compiler-dependent. I suspect Magmai was thinking about Visual C++ when he wrote that, so if it works for Borland you''re just lucky.

It probably would be better to learn how to link with libraries using your compilers commandline options, instead of stating it in the code itself. If you can''t find it in the docs, I''m sure the people in the turbo forum will be happy to tell you how to do that.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS