473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

To compile the VideoCapture module

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
0 2013

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: W F | last post by:
I haven't done much experimentation, so I am hoping someone will be able to save me the trouble. Does anyone know how to specify quickcam settings such as exposure time and gain when using...
8
by: Nick Coghlan | last post by:
Time for another random syntax idea. . . So, I was tinkering in the interactive interpreter, and came up with the following one-size-fits-most default argument hack: Py> x = 1 Py> def...
2
by: LP | last post by:
Hi, I have a site which runs on .Net technology. The site is already deployed and running. I need to change 1 file for some small enhancement. Please tell me, how can I compile that 1 file and...
1
by: Steve | last post by:
I get this message when I tried to make a .MDE of my database. "Compile error in hidden module: Form_frmPurchaseReq" I have been using this database for several months and just thought I would...
4
by: livin | last post by:
my log... INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp', urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On %2C+100&x=4&y=6'})) INFO INFO File...
0
by: Fuzzyman | last post by:
Hello all, The following is a copy of a blog entry. It's asking a question about future statements and the built in compile function. I'd appreciate any pointers or comments about possible...
1
by: Just Another Victim of the Ambient Morality | last post by:
I can't seem to get VideoCapture (http://videocapture.sourceforge.net/) to work with my version of Python (2.5). Why is that? I've followed the instructions which made it look easy but, as it...
16
by: pereges | last post by:
Do you see anything wrong about this method ? For eg. I write a shell script a.sh containing : cc -o test file1.c file2.c file3.c and then execute the shell script ( sh a.sh) to compile and...
6
by: Ed Leafe | last post by:
I've noticed an odd behavior with compile() and code that does not contain a trailing newline: if the last line is a comment inside of any block, a syntax error is thrown, but if the last line is a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.