• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 770
  • Last Modified:

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

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.
0
AnthonyFee
Asked:
AnthonyFee
  • 2
1 Solution
 
AlexFMCommented:
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.
0
 
AnthonyFeeAuthor Commented:
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!
0
 
AlexFMCommented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now