Thread: DDraw Problems

  1. #1
    Unregistered
    Guest

    DDraw Problems

    Hey, im having some serious problems using direct draw. I started off in codewarrior but couldnt get that to work so now im in Microsoft Visual C++ and the problems are persisting. First off, when im compiling its giving me the following errors:


    c:\program files\microsoft visual studio\vc98\include\rpcndr.h(78) : error C2144: syntax error : missing ';' before type 'int'

    c:\program files\microsoft visual studio\vc98\include\rpcndr.h(78) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.

    Any ideas on at lesat how to get that fixed?

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    The answer to your problem is in the error code:

    >>rpcndr.h

    open your rpcndr.h file

    >>(78)

    scroll down to line 78.

    >>missing ';' before type 'int'

    where you've declare an integer variable you forgot to put a semi-colon - ; .

    The second error is caused by the first. Put your missing ";" in it's place and they should both go away.

  3. #3
    Unregistered
    Guest
    that makes sense except that the header file was not made by me, it came with microsoft vis c++ and most likely doesnt have a mistake in it. not to mention ive looked at the line and am baffled as far as fixing it goes

  4. #4
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Right. I use VC++ 6 Pro but this is the first I've heard of rpcndr.h. I opened mine and line 78 doesn't even declare an int.

    But that being the case, this isn't a DirectDraw problem.

    From what I saw in rpcndr.h (I quickly scanned it) it defines data structures for helper functions (read line 7). Anyway, there is probably an object in there that is typedef'ed as an int that you are declaring in your project, and which you forgot to put a semi-colon at the end of the declaration line or at the end of a function call that is typedef'ed in rpcndr.h.

    If your program is broken down into several *.cpp files then compile each one individually (just double-click the file name in your FileView window and then click the compile button. This way you can better track down the line that's missing the semi-colon. You can't compile header files, but the error is in one of the headers you've made then when you compile a *.cpp file that includes it, it will find the error.

    If compiling when compiling them individually doesn't mark the exact line in your file that has the error it will at least let you know which of your files the error is in. Then you can go through that file line by line until you find it.

  5. #5
    Unregistered
    Guest

    Thumbs down

    The line of code which seems to be causing the problem is simply icluding ddraw.h. If we take that out then we don't have these errors, but once we add it in then we get problems. Also, our ddraw.h came right from the SDK so the file shouldn't be corrupt or anything.

  6. #6
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Post some code. We're getting nowhere with this.

  7. #7
    Unregistered
    Guest
    heres the .cpp code



    // MsTest.cpp : Defines the entry point for the application.
    //

    #include "stdafx.h"
    #include <c:\mssdk\include\ddraw.h>

    HWND g_hwnd;
    int APIENTRY WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
    {
    // TODO: Place code here.
    MessageBox(g_hwnd,"hi","test",MB_OK);
    return 0;
    }

  8. #8
    Please dont cross-post. Your post in C++ forum has been removed. Thank you.
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  9. #9
    Unregistered
    Guest
    thanks for the tip on cross posting but that doesnt particularly help ;-) whereas cross posting seemed to double my hits

  10. #10
    Unregistered
    Guest
    OK, ive been looking over the code and im pretty sure its not a semi colon error. It seems to be a linking error of the library or header files. I came to this conclusion because ive tried several different cpp files, not personally written but taken offline from sources clearly without error, and different versions of the ddraw library and header files. It simply must be a linking error, possibly of the order. So if anyone who uses Microsoft Visual C++ standard edition (or another edition) could give me some insight on how to go about doing all this then help me out. Particularly those who have worked with direct draw. THings such as link order should be considered i guess. anyhow, i need some help... so please try. thanks

  11. #11
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Since the error said it was missing a semicolon I'd be leaning towards a missing semicolon.

    But as far as linking order, in VC++ when you go to Tools->Options, then click on the Directories Tab. Pick Include Files from the "Show Directories For" combo box. When it populates the lists at the bottom make sure that the directory for your SDK's include files is listed, if not add it. Once you've added it (or if it's already there) click on the path for your SDK to highlight it. Next click the black up arrow below the "Show Directories For" combo box until the path for your SDK's include files is at the top of the list.

    Repeat and do the same for your Link directory. If your SDK's path is not in the proper place (at the top of the list) then when you link then it will use the first ddraw.h it finds, which would probably be the one in your VC98\Include folder.

  12. #12
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    whereas cross posting seemed to double my hits

    cross posting is just bad manners. have some respect, pick the single most appropriate forum and post your question there.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  13. #13
    Registered User Esss's Avatar
    Join Date
    Aug 2001
    Posts
    133
    > #include "stdafx.h"

    Which contains...?
    Ess
    Like a rat in a maze who says,
    "Watch me choose my own direction"
    Are you under the illusion
    The path is winding your way?
    - Rush

  14. #14
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    // TODO: Place code here.
    Please tell me you're not using MFC to develop a DirectX game.

  15. #15
    Unregistered
    Guest

    //TODO: PLACE CODE HERE

    If you open up a Win32 application and ask it to make simple one it gives you the WinMain function with //TODO: PLACE CODE HERE

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. C Pointers Problems
    By mhelal in forum C Programming
    Replies: 8
    Last Post: 01-10-2007, 06:35 AM
  3. Rendering problems (DirectX?)
    By OnionKnight in forum Tech Board
    Replies: 0
    Last Post: 08-17-2006, 12:17 PM
  4. DJGPP problems
    By stormswift in forum C Programming
    Replies: 2
    Last Post: 02-26-2002, 04:35 PM