编译出错,请大家帮忙看看.(directshow的例子)
--------------------Configuration: MEDIAR42 - EMULATOR: X86 Win32 (WCE emulator) Debug--
------------------
Platform header files are up-to-date...
MEDIAR42 - 0 error(s), 0 warning(s)
--------------------Configuration: 3 - EMULATOR: X86 Win32 (WCE emulator) Debug---------
-----------
Compiling...
3.cpp
Linking...
corelibc.lib(crtstrta.obj) : error LNK2019: unresolved external symbol _main referenced
in function _mainACRTStartup
EMULATOR__X86Dbg/3.exe : fatal error LNK1120: 1 unresolved externals
Error PB2505: Error executing link.exe.
3.exe - 3 error(s), 0 warning(s)
以上是错误,源码是sdk中的一个例子,我改了一下,现在只有这一个错了.
#include <windows.h>
#include <streams.h>
#define CLASSNAME "VideoWindow"
IGraphBuilder *pGraph = NULL;
IMediaControl *pMediaControl = NULL;
IVideoWindow *pVidWin = NULL;
HWND g_hwnd;
void PlayFile(void)
{
// Create the filter graph manager.
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **)&pGraph);
pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin);
// Build the graph.
pGraph->RenderFile(L"clock.avi", NULL);
//Set the video window.
pVidWin->put_Owner((OAHWND)g_hwnd);
pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
RECT grc;
GetClientRect(g_hwnd, &grc);
pVidWin->SetWindowPosition(0, 0, grc.right, grc.bottom);
// Run the graph.
pMediaControl->Run();
}
void CleanUp(void)
{
pVidWin->put_Visible(OAFALSE);
pVidWin->put_Owner(NULL);
pMediaControl->Release();
pVidWin->Release();
pGraph->Release();
}
// Message handler
long FAR PASCAL WindowProc( HWND hwnd, UINT msg, UINT wParam, LONG lParam)
{
switch (msg)
{
case WM_DESTROY:
CleanUp();
PostQuitMessage(0);
break;
default:
return (DefWindowProc(hwnd, msg, wParam, lParam));
}
return(NULL);
}
// Main
int PASCAL WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR pCmdLine, int nCmdShow)
{
MSG msg;
WNDCLASS wc;
CoInitialize(NULL);
ZeroMemory(&wc, sizeof wc);
wc.lpfnWndProc = WindowProc;
wc.hInstance = hInst;
wc.hIcon = NULL;
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = _T(CLASSNAME);
RegisterClass( &wc );
g_hwnd = CreateWindow(
_T(CLASSNAME),
_T("DirectShowSample"),
WS_OVERLAPPED,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInst,
NULL);
ShowWindow( g_hwnd, nCmdShow );
UpdateWindow( g_hwnd );
PlayFile();
while( GetMessage( &msg, NULL, 0, 0 ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
CoUninitialize();
return msg.wParam;
}
------------------
Platform header files are up-to-date...
MEDIAR42 - 0 error(s), 0 warning(s)
--------------------Configuration: 3 - EMULATOR: X86 Win32 (WCE emulator) Debug---------
-----------
Compiling...
3.cpp
Linking...
corelibc.lib(crtstrta.obj) : error LNK2019: unresolved external symbol _main referenced
in function _mainACRTStartup
EMULATOR__X86Dbg/3.exe : fatal error LNK1120: 1 unresolved externals
Error PB2505: Error executing link.exe.
3.exe - 3 error(s), 0 warning(s)
以上是错误,源码是sdk中的一个例子,我改了一下,现在只有这一个错了.
#include <windows.h>
#include <streams.h>
#define CLASSNAME "VideoWindow"
IGraphBuilder *pGraph = NULL;
IMediaControl *pMediaControl = NULL;
IVideoWindow *pVidWin = NULL;
HWND g_hwnd;
void PlayFile(void)
{
// Create the filter graph manager.
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **)&pGraph);
pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
pGraph->QueryInterface(IID_IVideoWindow, (void **)&pVidWin);
// Build the graph.
pGraph->RenderFile(L"clock.avi", NULL);
//Set the video window.
pVidWin->put_Owner((OAHWND)g_hwnd);
pVidWin->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
RECT grc;
GetClientRect(g_hwnd, &grc);
pVidWin->SetWindowPosition(0, 0, grc.right, grc.bottom);
// Run the graph.
pMediaControl->Run();
}
void CleanUp(void)
{
pVidWin->put_Visible(OAFALSE);
pVidWin->put_Owner(NULL);
pMediaControl->Release();
pVidWin->Release();
pGraph->Release();
}
// Message handler
long FAR PASCAL WindowProc( HWND hwnd, UINT msg, UINT wParam, LONG lParam)
{
switch (msg)
{
case WM_DESTROY:
CleanUp();
PostQuitMessage(0);
break;
default:
return (DefWindowProc(hwnd, msg, wParam, lParam));
}
return(NULL);
}
// Main
int PASCAL WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR pCmdLine, int nCmdShow)
{
MSG msg;
WNDCLASS wc;
CoInitialize(NULL);
ZeroMemory(&wc, sizeof wc);
wc.lpfnWndProc = WindowProc;
wc.hInstance = hInst;
wc.hIcon = NULL;
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = (HBRUSH)GetStockObject( BLACK_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = _T(CLASSNAME);
RegisterClass( &wc );
g_hwnd = CreateWindow(
_T(CLASSNAME),
_T("DirectShowSample"),
WS_OVERLAPPED,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInst,
NULL);
ShowWindow( g_hwnd, nCmdShow );
UpdateWindow( g_hwnd );
PlayFile();
while( GetMessage( &msg, NULL, 0, 0 ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
CoUninitialize();
return msg.wParam;
}
...全文
相关推荐
qt+directshow usb摄像头及音频设备录制视频的例子
这个"qt+directshow usb摄像头及音频设备录制视频的例子"中,开发者可能利用了Qt的QMultimedia模块与DirectShow的接口进行集成。
directshow 视频捕获例子
**测试与调试**: 由于描述中提到这个例子“绝对可以跑”,说明它应该包含了完整的运行逻辑和必要的配置,开发者可以通过编译和运行来体验和学习DirectShow的视频捕获功能。
Directshow Transform Filter例子
总结起来,这个例子是关于如何利用DirectShow的Transform Filter机制来实现图像数据的处理,特别是从YUV格式转换为灰度图像。
directshow 编译错误汇总
DirectShow 编译错误汇总主要涉及的是在开发DirectShow应用程序时遇到的各种编译问题及其解决方法。
vc下用directshow开发usb摄像头的例子
在这个“vc下用directshow开发usb摄像头的例子”中,我们将重点探讨如何在Visual C++(vc)环境下利用DirectShow API来实现USB摄像头的视频捕获并进行显示。


