By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,885 Members | 1,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,885 IT Pros & Developers. It's quick & easy.

To compile the VideoCapture module

P: n/a
Hello (and sorry for my English),

I downloaded the VideoCapture module on the
http://videocapture.sourceforge.net/ site. I tested it with a webcam and
that functions.

Now I want to compile his file .cpp (vidcap.cpp). Thereafter, the idea is to
be able to modify the code to include my own modifications.

For the moment I only try to compile, but does not arrive :(

I will try to pose my problem :

First of all I am under Windows xp because I must use DirectX. I use the
MinGW compiler. I use following script (setup.py) to be able to compile :


nomModule = 'vidcap'

from distutils.core import setup, Extension

setup(name = nomModule, ext_modules = [ Extension(nomModule, sources = [
nomModule+'.cpp'],\

include_dirs=["C:\DX90SDK\Include","C:\DX90SDK\Samples\C++\Direc tShow\BaseClasses"],\

library_dirs=["C:\Python23\libs","C:\DX90SDK\Lib","C:\Python23\E nthought\MingW\lib"])
])

The include_dirs enable me to indicate the access path has my .h that I
need. And library_dirs in theory the libraries which I need (I say in theory
because I do not have the impression that it takes into account, but we will
return later).

I try so the first compilation with : python setup.py build

I have a few errors

I try to resolve them

Here the modifications which I have of bringing :

In strmif.h:

line 6164 : replace #ifndef _WINGDI_ by #ifndef _WINGDI_H

line 20557 : Add EXTERN_GUID definition just before first EXTERN_GUID():

#ifndef EXTERN_GUID

#define EXTERN_GUID(g,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8)
DEFINE_GUID(g,l1,s1,s2,c1,c2,c3,c4,c5,c6,c7,c8)

#endif

line 28736 : Fix the tagVMRGUID struct (GUID -::GUID)

::GUID *pGUID;

::GUID GUID;

Put UrlMon.h in the file include of DX90SDK (recover it in Microsoft
Platform SDK) in the same way for MsXml.h.

Then to define uCLSSPEC and QUERYCONTEXT, I have includes their definition
directly in my file .cpp :

//--------------------------------------------------------------------------------------

// definitions recuperées de c:\Program Files\Microsoft Plateform
SDK\include\WTypes.h

typedef struct tagCSPLATFORM

{

DWORD dwPlatformId;

DWORD dwVersionHi;

DWORD dwVersionLo;

DWORD dwProcessorArch;

} CSPLATFORM;

#ifndef _LCID_DEFINED

#define _LCID_DEFINED

typedef DWORD LCID;

#endif // !_LCID_DEFINED

typedef struct tagQUERYCONTEXT

{

DWORD dwContext;

CSPLATFORM Platform;

LCID Locale;

DWORD dwVersionHi;

DWORD dwVersionLo;

} QUERYCONTEXT;

typedef WCHAR OLECHAR;

typedef OLECHAR *LPOLESTR;

typedef struct __MIDL___MIDL_itf_wtypes_0003_0001

{

DWORD tyspec;

union __MIDL___MIDL_itf_wtypes_0003_0005

{

CLSID clsid;

LPOLESTR pFileExt;

LPOLESTR pMimeType;

LPOLESTR pProgId;

LPOLESTR pFileName;

struct

{

LPOLESTR pPackageName;

GUID PolicyId;

} ByName;

struct

{

GUID ObjectId;

GUID PolicyId;

} ByObjectId;

} tagged_union;

} uCLSSPEC;

//--------------------------------------------------------------------------------------

Last thing modified in vidcap.cpp :

line 774 : /*statichere*/ PyTypeObject Dev_Type = {
Comment out statichere, because it was already declared in extern.

After all these modifications, I compile again and no errors but...

Here what I obtain with compilation :
running install

running build

running build_ext

building 'vidcap' extension

C:\Python23\Enthought\MingW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\DX90SDK\Include
-IC:\DX

90SDK\Samples\C++\DirectShow\BaseClasses -Ic:\Python23\include -Ic:\Python23\PC
-c vidcap.cpp -

o build\temp.win32-2.3\Release\vidcap.o

In file included from C:/DX90SDK/Include/dshow.h:46,

from vidcap.cpp:24:

C:/DX90SDK/Include/strmif.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/dshow.h:46,

from vidcap.cpp:24:

C:/DX90SDK/Include/strmif.h:877: warning: ignoring #pragma warning

C:/DX90SDK/Include/strmif.h:878: warning: ignoring #pragma warning

C:/DX90SDK/Include/strmif.h:30645: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/dshow.h:49,

from vidcap.cpp:24:

C:/DX90SDK/Include/control.h:2: warning: ignoring #pragma warning

In file included from vidcap.cpp:73:

C:/DX90SDK/Include/qedit.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/qedit.h:492,

from vidcap.cpp:73:

C:/DX90SDK/Include/dxtrans.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/d3d.h:189,

from C:/DX90SDK/Include/dxtrans.h:278,

from C:/DX90SDK/Include/qedit.h:492,

from vidcap.cpp:73:

C:/DX90SDK/Include/d3dtypes.h:26: warning: ignoring #pragma warning

C:/DX90SDK/Include/d3dtypes.h:2116: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/dxtrans.h:280,

from C:/DX90SDK/Include/qedit.h:492,

from vidcap.cpp:73:

C:/DX90SDK/Include/urlmon.h:17: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/urlmon.h:278,

from C:/DX90SDK/Include/dxtrans.h:280,

from C:/DX90SDK/Include/qedit.h:492,

from vidcap.cpp:73:

C:/DX90SDK/Include/msxml.h:17: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/dxtrans.h:280,

from C:/DX90SDK/Include/qedit.h:492,

from vidcap.cpp:73:

C:/DX90SDK/Include/urlmon.h:301: warning: ignoring #pragma comment

In file included from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/amstream.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/amstream.h:107,

from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/mmstream.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/amstream.h:108,

from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/strmif.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/amstream.h:122,

from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/mmstream.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/amstream.h:123,

from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/ddstream.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/ddstream.h:59,

from C:/DX90SDK/Include/amstream.h:123,

from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/mmstream.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/amstream.h:124,

from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/austream.h:2: warning: ignoring #pragma warning

In file included from C:/DX90SDK/Include/austream.h:71,

from C:/DX90SDK/Include/amstream.h:124,

from C:/DX90SDK/Include/qedit.h:493,

from vidcap.cpp:73:

C:/DX90SDK/Include/mmstream.h:2: warning: ignoring #pragma warning

writing build\temp.win32-2.3\Release\vidcap.def

cc -mno-cygwin -shared -s build\temp.win32-2.3\Release\vidcap.o
build\temp.win32-2.3\Release\vidcap.def -LC:\Python23\libs -LC:\DX90SDK\Lib
-LC:\Python23\Enthought\MingW\lib -Lc:\Python23\libs -Lc:\Python23\PCBuild -lpython23
-o build\lib.win32-2.3\vidcap.pyd

error: command 'cc' failed: No such file or directory

I obtain warning, but I think that we can be to ignore them.

(#pragma warning( disable: 4049 ) /* more than 64k source lines */)

Then my problem it is that it does not create my module .pyd. Maybe linker
error ? But I don't see why that command 'cc' failed ! (I use gcc)

I think the part C:\Python23\Enthought\MingW\bin\g in beginning line was
disappeared !

I try to run all this command line, i.e. :

C:\Python23\Enthought\MingW\bin\gcc -mno-cygwin -shared -s
build\temp.win32-2.3\Release\vidcap.o
build\temp.win32-2.3\Release\vidcap.def -LC:\Python23\libs -LC:\DX90SDK\Lib
-LC:\Python23\Enthought\MingW\lib -Lc:\Python23\libs -Lc:\Python23\PCBuild -lpython23
-o build\lib.win32-2.3\vidcap.pyd
Here a part of result :
build\temp.win32-2.3\Release\vidcap.o(.text+0x570):vidcap.cpp: undefined
reference to `IID_IGraphBuilder'

build\temp.win32-2.3\Release\vidcap.o(.text+0x579):vidcap.cpp: undefined
reference to `CLSID_FilterGraph'

build\temp.win32-2.3\Release\vidcap.o(.text+0x57e):vidcap.cpp: undefined
reference to `CoCreateInstance@20'

build\temp.win32-2.3\Release\vidcap.o(.text+0x59e):vidcap.cpp: undefined
reference to `IID_ICaptureGraphBuilder2'

build\temp.win32-2.3\Release\vidcap.o(.text+0x5a7):vidcap.cpp: undefined
reference to `CLSID_CaptureGraphBuilder2'

build\temp.win32-2.3\Release\vidcap.o(.text+0x5ac):vidcap.cpp: undefined
reference to `CoCreateInstance@20'

....
I think it is a problem of linker error. However I show the right directory
to recover libraries
(-LC:\Python23\libs -LC:\DX90SDK\Lib -LC:\Python23\Enthought\MingW\lib), but
apparently does not take into account.

In short, how to make ?

If I did not take the right method of resolution of my problem, how then I
do to proceed ?


Thanks for any ideas.



Ps : I also wanted to compile it under dev-cpp to see. Result, same problem,
but only 5 or 6 linker errors.

I include in the parameters of linker :

C:/Python23/libs/libpython23.a

C:/DX90SDK/Lib/amstrmid.lib

C:/Python23/Enthought/MingW/lib/libole32.a

C:/Python23/Enthought/MingW/lib/liboleaut32.a



Regards,


Jérôme
Jul 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.