Thread: DirectX 8 with Borland

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    118

    DirectX 8 with Borland

    I am having major problems compiling a DirectX 8 program using Borland 5.5. I was told that DirectX 8 needs different lib files to use with it, so I found a site and downloaded them. Still nothing works. Does anyone have any suggestions on how to go about it. I tried the Borland site, but that is no help at all. I use DirectX 7 now, and would like to take the plung from DirectX to Direct3D, but it seems so confusing just to set up Borland to compile. Im sure lots of people will suggest Microsoft's compiler, but i've used Borland for a year now with DirectX 7 and would like to continue, if at all possible. Thanks in advance.
    "The distinction between past, present and future is only an illussion, even if a stunning one."
    -Albert Einstein

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Hopefully you've downloaded the SDK from Microsoft. If you haven't - do so. The latest SDK is 9.1, but you can probably still get 8.

    You will need to link some (or all) of the following libs:
    - dxguid.lib
    - d3d9.lib
    - d3dx9.lib
    - dinput8.lib

    You will need to #include the following headers (the second is somewhat optional):

    #include <d3d9.h>
    #include <d3dx8.h>

    I'm not sure what "major problems" you're having. You might want to check the SDK documentation and see if that has anything.
    Away.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    118
    I finally got it to compile! I copied the include files from DirectX 8 to the Borland include directory and it worked. Probably there was a way to point Borland to the include files, but it seems to work this way. Since I figured out my first problem, i've run into another. When I try to compile a simple DirectX 8 program that creates a surface with a back buffer and then shows it to the screen using the 'present' function, an error comes up saying there's a call to an undefined function 'sqrtf'. The error is shown showing up in a file called 'd3dx8math.inl' and I think it has to do with the loading of the bmp. I know the error is from the '#include <d3dx8tex.h>. There seems to be no library file for that include. Anyone know if it could be under a different name? This is probably a problem that has to do with my compiler setup, so i'll probably have to figure this one out on my own, but any suggestions would help. Thanks for the above info.
    "The distinction between past, present and future is only an illussion, even if a stunning one."
    -Albert Einstein

  4. #4
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    ummm...

    #include <math.h> should do it.
    Away.

  5. #5
    Registered User
    Join Date
    Oct 2002
    Posts
    118
    I tried to use <math> include but it still comes up with the same error. Thanks though. Any other suggestions? It seems to be the only error stnading between a successful compile. I think I might just go out and by Microsoft's compiler. Which one would be the best? Thanks.
    "The distinction between past, present and future is only an illussion, even if a stunning one."
    -Albert Einstein

  6. #6
    >>Which one would be the best?

    Visual C++. There's a student edition which is drastically cheaper. The standard edition is quite worth the price though IMHO.
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  7. #7
    Registered User
    Join Date
    Oct 2002
    Posts
    118
    is Visual C++.NET the same?
    "The distinction between past, present and future is only an illussion, even if a stunning one."
    -Albert Einstein

  8. #8
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    Yes and no. There are several versions of each edition of MSVC. They're typically something like this (I might forget some)

    CCE (do they still do this?)
    Student
    Standard
    Professional
    Enterprise

    I personally have Professional (50 cents at a garage sale, unopened, with all the documentation!)

    Anyway, .NET is (imho) Microsoft's most recent attempt to take over the language. It requires a bunch of "strange" things. I'd get a copy of MSVC 6 Standard if you could. The only problem with that is that it's a few years old now
    Away.

  9. #9
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    (50 cents at a garage sale, unopened, with all the documentation!)
    That's it, I'm moving to your neighbourhood

    If you're not worried about copyright infringement, you can probably get VC++ 6 off Kazaa; make sure you scan it for viruses
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  10. #10
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Originally posted by blackrat364
    Anyway, .NET is (imho) Microsoft's most recent attempt to take over the language. It requires a bunch of "strange" things. I'd get a copy of MSVC 6 Standard if you could. The only problem with that is that it's a few years old now
    Get .NET 2003. It's essentially VC++ 7.1, which is the single most ANSI-standard compiler out there -- it's actually older versions of VC which "require strange things", because older versions have horrible standards compliance.

    7.1 is lightyears above 6.0, and although it CAN compile managed code, there's no requirement. The only 6.0 code that 7.1 won't accept is code that worked because of errors in 6.0.

    6.0 had major errors, 7.0 (the original .NET release) had most of the same. But 7.1 (.NET 2003) fixed them, and did a good job.

  11. #11
    Registered User
    Join Date
    Oct 2002
    Posts
    118
    I decided to go with Visual C++ 7.0. I tried to download off of Kazaa (just to see if it would do what I wanted - Im a total believer in buying the software) , and it downloaded in about eight hours. It had a few errors when expanding it, but it seems to work fine when I install it in Basic version. It works perfect with directx 8 , and I don't have to worry about downloading any stupid lib files from borland. I like the set up, and it seems much easier than Borland 5.5. It took a while to figure how to include the lib files because it is so much different than Borland, but I now love it! Also, I thought the change from DirectX 7 to 8 was going to be hard, but it seems pretty easy. It is much different, but follows the same basic principles. I think if I didn't learn DirectX 7 first, I would be horribly lost with 8. It seems easier, cleaner, and has lot's of functions that are already made for you. Anyways, thanks for all your help and when I finish my game I will be sure to post it.
    "The distinction between past, present and future is only an illussion, even if a stunning one."
    -Albert Einstein

  12. #12
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    It took a while to figure how to include the lib files because it is so much different than Borland
    Why don't people just use #pragma comment(lib, "thelib.lib")? Or is that microsoft-specific botch or does it affect running speed or something??
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  2. THE END - Borland C++ Builder, Delphi, J Builder?
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 02-28-2006, 11:23 PM
  3. Borland and DirectX
    By Dark Nemesis in forum Game Programming
    Replies: 4
    Last Post: 05-13-2004, 08:55 PM
  4. Setting up directx 8.0 sdk with Borland command-line compiler
    By ganonl in forum Windows Programming
    Replies: 0
    Last Post: 08-06-2003, 05:16 PM
  5. DirectX + Borland CBuilder 5
    By kitten in forum C++ Programming
    Replies: 0
    Last Post: 09-20-2001, 02:23 AM