Thread: Using DXUT with Borland 5.5 free compiler

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    7

    Using DXUT with Borland 5.5 free compiler

    I am starting to learn DirectX since I want to make games.
    I have been able to do a lot so far, but with the compiler I use (The free borland one version 5.5,) I cannot seem to use the DXUT functions.
    When I try to define with DXUT.h included, I get a LOT of errors from various include files that it references. Without that definition, my test program will compile fine.

    I don't know if I'm doing something wrong or if the compiler just can't work with it.

    Here is the error output I get when I try to compile it:
    Code:
    bcc32 -WU c:\prog\directx\test.cpp
    
    Error E2303 c:\Borland\Bcc55\include\d3dx10core.h 51: Type name expected
    Error E2303 c:\Borland\Bcc55\include\d3dx10core.h 57: Type name expected
    Error E2147 c:\Borland\Bcc55\include\d3dx10core.h 65: 'ID3D10Device' cannot star
    t a parameter declaration
    Error E2303 c:\Borland\Bcc55\include\d3dx10core.h 115: Type name expected
    Error E2139 c:\Borland\Bcc55\include\d3dx10core.h 115: Declaration missing ;
    Error E2293 c:\Borland\Bcc55\include\d3dx10core.h 172: ) expected
    Error E2147 c:\Borland\Bcc55\include\d3dx10core.h 182: 'ID3D10Device' cannot sta
    rt a parameter declaration
    Error E2293 c:\Borland\Bcc55\include\d3dx10core.h 323: ) expected
    Error E2303 c:\Borland\Bcc55\include\d3dx10core.h 330: Type name expected
    Error E2139 c:\Borland\Bcc55\include\d3dx10core.h 342: Declaration missing ;
    Error E2040 c:\Borland\Bcc55\include\d3dx10core.h 349: Declaration terminated in
    correctly
    Error E2190 c:\Borland\Bcc55\include\d3dx10core.h 349: Unexpected }
    Error E2190 c:\Borland\Bcc55\include\d3dx10core.h 349: Unexpected }
    Error E2147 c:\Borland\Bcc55\include\d3dx10core.h 375: 'ID3D10Device' cannot sta
    rt a parameter declaration
    Error E2147 c:\Borland\Bcc55\include\d3dx10core.h 390: 'ID3D10Device' cannot sta
    rt a parameter declaration
    Error E2147 c:\Borland\Bcc55\include\d3dx10core.h 412: 'ID3D10Device' cannot sta
    rt a parameter declaration
    Error E2147 c:\Borland\Bcc55\include\d3dx10core.h 418: 'ID3D10Device' cannot sta
    rt a parameter declaration
    Error E2147 c:\Borland\Bcc55\include\d3dx10core.h 428: 'ID3D10Device' cannot sta
    rt a parameter declaration
    Error E2303 c:\Borland\Bcc55\include\d3dx10tex.h 220: Type name expected
    Error E2139 c:\Borland\Bcc55\include\d3dx10tex.h 220: Declaration missing ;
    Error E2303 c:\Borland\Bcc55\include\d3dx10tex.h 283: Type name expected
    Error E2139 c:\Borland\Bcc55\include\d3dx10tex.h 283: Declaration missing ;
    Error E2451 c:\Borland\Bcc55\include\d3dx10tex.h 300: Undefined symbol 'Usage' i
    n function D3DX10_IMAGE_LOAD_INFO::D3DX10_IMAGE_LOAD_INFO()
    Error E2314 c:\Borland\Bcc55\include\d3dx10tex.h 300: Call of nonfunction in fun
    ction D3DX10_IMAGE_LOAD_INFO::D3DX10_IMAGE_LOAD_INFO()
    Error E2147 c:\Borland\Bcc55\include\d3dx10tex.h 441: 'ID3D10Device' cannot star
    t a parameter declaration
    Error E2228 c:\Borland\Bcc55\include\d3dx10tex.h 441: Too many error or warning
    messages
    *** 26 errors in Compile ***
    I am not really familiar with DirectX, but could I be leaving out a lib it needs to work?
    Here is the program I am trying to compile. I removed everything but the basics for this test:
    Code:
    #include <windows.h>
    #include <windowsx.h>
    #include <directx/d3d9.h>
    #include <directx/dxut.h>
    
    #pragma comment (lib, "d3d9.lib")
    
    
    LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
    
    
    
    int WINAPI wmain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPSTR lpCmdLine,
                       int nCmdShow)
    {
        HWND hWnd;
        WNDCLASSEX wc;
    
        ZeroMemory(&wc, sizeof(WNDCLASSEX));
    
        wc.cbSize = sizeof(WNDCLASSEX);
        wc.style = CS_HREDRAW | CS_VREDRAW;
        wc.lpfnWndProc = (WNDPROC)WindowProc;
        wc.hInstance = hInstance;
        wc.hCursor = LoadCursor(NULL, IDC_ARROW);
        wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
        wc.lpszClassName = L"WindowClass";
    
        RegisterClassEx(&wc);
    
        hWnd = CreateWindowEx(NULL,
                              L"WindowClass",
                              L"A Basic Test",
                              WS_OVERLAPPEDWINDOW,
                              300, 300,
                              640, 480,
                              NULL,
                              NULL,
                              hInstance,
                              NULL);
    
        ShowWindow(hWnd, nCmdShow);
    
        MSG msg;
    
        while(TRUE)
        {
            DWORD starting_point = GetTickCount();
    
            if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
            {
                if (msg.message == WM_QUIT)
                    break;
    
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
    
        
        }
    
    
    
        return msg.wParam;
    }
    
    
    
    LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
        switch(message)
        {
            case WM_DESTROY:
                {
                    PostQuitMessage(0);
                    return 0;
                } break;
        }
    
        return DefWindowProc (hWnd, message, wParam, lParam);
    }
    It compiles and links fine if I leave out the definition of dxut.h/
    Any help would be really great, as I am stumped.
    Thanks!

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I do not recommend using Borland with DirectX libraries. Many of the types, from what I recall, are not compatible with Borland without significant massaging on the part of the programmer.

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    7
    Hmmm, ok.
    Can you recommend a free compiler that supports directX?
    Also I would prefer not to use Microsoft's unnecessarily huge program, and I'd assume it's not the only compiler that supports directX.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I don't know if gcc will work, but that's the only realistic other option. Perhaps Code::Blocks with the gcc-mingw.

    However, I would recommend (even if you say you don't want that) MS Visual Studio 2008 Express edition. It is free - but it's certainly bigger than the other options.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Feb 2009
    Posts
    7
    Well, ok.
    In that case my only question is where I can download the C++ Visual Studio Express in full form?
    (I need to download it onto a flashdrive and take it to my non-internet computer.)
    All I can find is a 'web install', which I hate and cannot use.

    Thanks for your help/

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    You mean the "Offline install" here:
    http://www.microsoft.com/express/download/default.aspx

    You need to scroll down a bit.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Registered User
    Join Date
    Feb 2009
    Posts
    7
    Ah thanks, didn't notice that before.
    ops:
    Thanks alot

  8. #8
    Registered User
    Join Date
    Feb 2009
    Posts
    7
    Ok, I've installed it and DXUT seems to work fine now.
    Too bad, I liked Borland, but I suppose this switch was inevitable
    Thanks for the help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best C compiler (free)
    By esbo in forum C Programming
    Replies: 11
    Last Post: 06-11-2007, 10:38 PM
  2. "if you love someone" :D
    By Carlos in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 10-02-2003, 01:10 AM
  3. Compiler Design... Anyone That Can Help!
    By ComputerNerd888 in forum C++ Programming
    Replies: 3
    Last Post: 09-27-2003, 09:48 AM
  4. EzWindows and Borland 5.5 free compiler
    By savageag in forum C++ Programming
    Replies: 0
    Last Post: 09-15-2003, 09:49 PM
  5. free c++ compiler?
    By sayword in forum C++ Programming
    Replies: 4
    Last Post: 09-06-2003, 10:49 PM