C++ Compiler error - sytax error : missing ';' before Hsemaphore

Posted on 2004-11-29
Last Modified: 2008-02-07
This should be simple enough to solve but I have never come across this error in C++. This problem appears on line 1018 of strmif.h. this header file is used by Dshow.h which is a header file used with DirectX. The full line is

typedef DWORD_PTR Hsemaphore;

This is not the only definition it happens to. anything defined in the same way returns an error.
After the error shown above the compiler also returns an error "unexpected end of file" on the same line. I would appreciate any information on this error.
Question by:AnthonyFee
    LVL 48

    Expert Comment

    DWORD_PTR us unsigned long. You need to install Microsoft SDK to compile this code. If you already have SDK installed, ensure that SDK include directories are searched before VC++ include directories.
    If you want to compile this without SDK, add line:

    typedef unsigned long DWORD_PTR

    before including of Dshow.h.

    Author Comment

    hey. thanks for the reply. i have discovered that the problem was to do with the latest summer release of the SDK for directx. Apparently it's not compatible with Microsoft visual studios 6. When i downloaded an earlier version these errors disappeared but I have gotten a few more I hope you can help me with. They are all in the building stage again and seem to be all based around the same problem. below are a few examples.

    Example.obj : error LNK2001: unresolved external symbol _MEDIASUBTYPE_Y411

    Example.obj : error LNK2001: unresolved external symbol _MEDIASUBTYPE_YVU9

    Example.obj : error LNK2001: unresolved external symbol "void __cdecl _CVAssert(char const *,char const *,int,char const *)" (?_CVAssert@@YAXPBD0H0@Z)

    Example.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Video

    Example.obj : error LNK2001: unresolved external symbol "void __cdecl _CVTrace(char const *,char const *,int)" (?_CVTrace@@YAXPBD0H@Z)

    It seems that the linker can't locate all it wants to but i don't know how to go about resolving these errors. I have all files that are used included in the main cpp file. Thanks again for your help!
    LVL 48

    Accepted Solution

    You need to add some .lib file to the linker list: Project - Properties - Link - Object/library modules. Type here .lib file name.
    I don't know what library do you need, you can find this in MSDN Library topics describing DirectX functions used in the project.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    mirrorEnds challenge 6 64
    sum28 challenge 31 82
    sameEnds challenge 25 55
    endX challenge 2 30
    This article will show, step by step, how to integrate R code into a R Sweave document
    A short article about a problem I had getting the GPS LocationListener working.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now