OVH Cloud OVH Cloud

Compiler le module VideoCapture

4 réponses
Avatar
Jérôme Le Bougeant
Bonjour,



J'ai récupéré le module de VideoCapture sur le site
http://videocapture.sourceforge.net/.

Je l'ai testé avec une webcam et cela marche.




Maintenant je veux recompiler son fichier .cpp (vidcap.cpp) qui se trouve
dans les sources pour créer moi même mon module. L'idée par la suite est de
pouvoir modifier le code pour inclure mes propres modifications. Mais bon,
je n'en suis pas la.




Pour l'instant j'essaye seulement de recompiler, mais hélas n'y arrive pas
:(




Bon je vais essayer de poser mon problème :




Tout d'abord je suis sous windows xp puisque je dois utiliser DirectX.
J'utilise le compilateur MinGW.

J'utilise le script suivant (setup.py) pour pouvoir compiler :




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++\DirectShow\BaseClasses"],\

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




Les include_dirs me permettent d'indiquer le chemin d'accès a mes .h que
j'ai besoin.

Et library_dirs en théorie les librairies dont j'ai besoin (je dis en
théorie parce que je n'ai pas l'impression qu'il prend en compte, mais on
reviendra plus tard).




J'essaye donc une première compilation avec la commande : python setup.py
build

Il me sort un bon nombre d'erreur.

J'essaye de les résoudre.

Voici les modifications que j'ai du apporter :




Dans strmif.h:

ligne 6164 : remplacer #ifndef _WINGDI_ par #ifndef _WINGDI_H




ligne 20557 : Ajouter la définition de EXTERN_GUID juste avant l'appel de
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




ligne 28736 : Dans la structure tagVMRGUID, remplacer GUID par ::GUID :

::GUID *pGUID;

::GUID GUID;







mettre UrlMon.h dans le dossier include de DX90SDK (récupérez le dans
Microsoft Platform SDK) de meme pour MsXml.h. (En mettant son chemin d'accès
j'avais encore plus de probleme lol, j'avais l'impression qu'il restait dans
ce répertoire et prenait les .h de celui ci au lieu de DirectX !)




Ensuite pour définir uCLSSPEC et QUERYCONTEXT, j'ai inclut leur définition
directement dans mon fichier .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;

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




Je l'ai récupéré directement dans le fichier WTypes.h. Si j'incluais ce
fichier, j'avais d'autre erreurs !! sur des types que je n'utilisais pas.




Ah oui dernière chose modifié dans vidcap.cpp :




ligne 774 : /*statichere*/ PyTypeObject Dev_Type = {




J'ai mit en commentaire statichere, puisqu'il me signalait qu'il était déà
déclarer plus haut en extern.







Après toutes ces modifications, je recompile et je n'obtient plus d'erreur
mais...

Voici ce que j'obtient à la 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







J'obtient des warning, mais bon je me dit qu'on peut les ignorer.

(a priori, les warning ce n'est que : #pragma warning( disable: 4049 ) /*
more than 64k source lines */)




Alors mon problème c'est qu'il ne crée pas mon module .pyd. Apparement un
problème d'édition des liens. Mais je n'arrive pas a comprendre pourquoi il
me met que la commande 'cc' est introuvable (alors que j'utilise gcc) !!

J'ai l'impression que la partie C:\Python23\Enthought\MingW\bin\g en début
de ligne a disparu !

(je tiens à signaler que ce même fichier setup.py me permet de construire
d'autre module de base bien plus simple)

Bon alors j'essaye de rentrer moi même toute cette ligne de commande, c'est
à dire :

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




Voici ce qu'il me sort et ce n'est qu'une partie (une bonne soixantaine en
tout) :




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'




Donc voilà, comme je l'ai dit plus haut, à mon avis c'est un problème de
lien. Pourtant j'indique bien le répertoire où il doit récupérer les
librairies
(-LC:\Python23\libs -LC:\DX90SDK\Lib -LC:\Python23\Enthought\MingW\lib),
mais apparement il n'en prend pas compte.




Bref, comment faire ?

Si je n'ai pas pris la bonne méthode de résolution de mon problème, comment
puis-je procéder ?

J'attend vos lumières.

Je vous remerci si vous avez eu le courage de me lire :) Si je n'ai pas été
clair sur un point, dites le moi.

Toute remarque sera la bien venue.







Ps : j'ai voulu aussi le compiler sous dev-cpp pour voir. Résultat, même
problème, a part qu'il ne me reste plus que 5 ou 6 erreurs de linkage.

J'ai inclut dans les paramètres d'éditeur de lien :

C:/Python23/libs/libpython23.a

C:/DX90SDK/Lib/amstrmid.lib

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

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

4 réponses

Avatar
NicolasP
Bonjour,



J'ai récupéré le module de VideoCapture sur le site
http://videocapture.sourceforge.net/.

Je l'ai testé avec une webcam et cela marche.




Maintenant je veux recompiler son fichier .cpp (vidcap.cpp) qui se trouve
dans les sources pour créer moi même mon module. L'idée par la suite est de
pouvoir modifier le code pour inclure mes propres modifications. Mais bon,
je n'en suis pas la.




Pour l'instant j'essaye seulement de recompiler, mais hélas n'y arrive pas
:(




Bon je vais essayer de poser mon problème :




Tout d'abord je suis sous windows xp puisque je dois utiliser DirectX.
J'utilise le compilateur MinGW.

J'utilise le script suivant (setup.py) pour pouvoir compiler :




nomModule = 'vidcap'




from distutils.core import setup, Extension

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

include_dirs=["C:DX90SDKInclude","C:DX90SDKSamplesC++DirectShowBaseClasses"],

library_dirs=["C:Python23libs","C:DX90SDKLib","C:Python23EnthoughtMingWlib"])
])




Les include_dirs me permettent d'indiquer le chemin d'accès a mes .h que
j'ai besoin.

Et library_dirs en théorie les librairies dont j'ai besoin (je dis en
théorie parce que je n'ai pas l'impression qu'il prend en compte, mais on
reviendra plus tard).




J'essaye donc une première compilation avec la commande : python setup.py
build

Il me sort un bon nombre d'erreur.

J'essaye de les résoudre.

Voici les modifications que j'ai du apporter :




Dans strmif.h:

ligne 6164 : remplacer #ifndef _WINGDI_ par #ifndef _WINGDI_H




ligne 20557 : Ajouter la définition de EXTERN_GUID juste avant l'appel de
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




ligne 28736 : Dans la structure tagVMRGUID, remplacer GUID par ::GUID :

::GUID *pGUID;

::GUID GUID;







mettre UrlMon.h dans le dossier include de DX90SDK (récupérez le dans
Microsoft Platform SDK) de meme pour MsXml.h. (En mettant son chemin d'accès
j'avais encore plus de probleme lol, j'avais l'impression qu'il restait dans
ce répertoire et prenait les .h de celui ci au lieu de DirectX !)




Ensuite pour définir uCLSSPEC et QUERYCONTEXT, j'ai inclut leur définition
directement dans mon fichier .cpp :




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

// definitions recuperées de c:Program FilesMicrosoft Plateform
SDKincludeWTypes.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;

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




Je l'ai récupéré directement dans le fichier WTypes.h. Si j'incluais ce
fichier, j'avais d'autre erreurs !! sur des types que je n'utilisais pas.




Ah oui dernière chose modifié dans vidcap.cpp :




ligne 774 : /*statichere*/ PyTypeObject Dev_Type = {




J'ai mit en commentaire statichere, puisqu'il me signalait qu'il était déà
déclarer plus haut en extern.







Après toutes ces modifications, je recompile et je n'obtient plus d'erreur
mais...

Voici ce que j'obtient à la compilation :




running install

running build

running build_ext

building 'vidcap' extension

C:Python23EnthoughtMingWbingcc.exe -mno-cygwin -mdll -O -Wall -IC:DX90SDKInclude
-IC:DX

90SDKSamplesC++DirectShowBaseClasses -Ic:Python23include -Ic:Python23PC
-c vidcap.cpp -

o buildtemp.win32-2.3Releasevidcap.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 buildtemp.win32-2.3Releasevidcap.def

cc -mno-cygwin -shared -s buildtemp.win32-2.3Releasevidcap.o
buildtemp.win32-2.3Releasevidcap.def -LC:Python23libs -LC:DX90SDKLib
-LC:Python23EnthoughtMingWlib -Lc:Python23libs -Lc:Python23PCBuild -lpython23
-o buildlib.win32-2.3vidcap.pyd

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







J'obtient des warning, mais bon je me dit qu'on peut les ignorer.

(a priori, les warning ce n'est que : #pragma warning( disable: 4049 ) /*
more than 64k source lines */)




Alors mon problème c'est qu'il ne crée pas mon module .pyd. Apparement un
problème d'édition des liens. Mais je n'arrive pas a comprendre pourquoi il
me met que la commande 'cc' est introuvable (alors que j'utilise gcc) !!

J'ai l'impression que la partie C:Python23EnthoughtMingWbing en début
de ligne a disparu !

(je tiens à signaler que ce même fichier setup.py me permet de construire
d'autre module de base bien plus simple)

Bon alors j'essaye de rentrer moi même toute cette ligne de commande, c'est
à dire :

C:Python23EnthoughtMingWbingcc -mno-cygwin -shared -s
buildtemp.win32-2.3Releasevidcap.o
buildtemp.win32-2.3Releasevidcap.def -LC:Python23libs -LC:DX90SDKLib
-LC:Python23EnthoughtMingWlib -Lc:Python23libs -Lc:Python23PCBuild -lpython23
-o buildlib.win32-2.3vidcap.pyd




Voici ce qu'il me sort et ce n'est qu'une partie (une bonne soixantaine en
tout) :




buildtemp.win32-2.3Releasevidcap.o(.text+0x570):vidcap.cpp: undefined
reference to `IID_IGraphBuilder'

buildtemp.win32-2.3Releasevidcap.o(.text+0x579):vidcap.cpp: undefined
reference to `CLSID_FilterGraph'

buildtemp.win32-2.3Releasevidcap.o(.text+0x57e):vidcap.cpp: undefined
reference to `'

buildtemp.win32-2.3Releasevidcap.o(.text+0x59e):vidcap.cpp: undefined
reference to `IID_ICaptureGraphBuilder2'

buildtemp.win32-2.3Releasevidcap.o(.text+0x5a7):vidcap.cpp: undefined
reference to `CLSID_CaptureGraphBuilder2'

buildtemp.win32-2.3Releasevidcap.o(.text+0x5ac):vidcap.cpp: undefined
reference to `'




Donc voilà, comme je l'ai dit plus haut, à mon avis c'est un problème de
lien. Pourtant j'indique bien le répertoire où il doit récupérer les
librairies
(-LC:Python23libs -LC:DX90SDKLib -LC:Python23EnthoughtMingWlib),
mais apparement il n'en prend pas compte.




Bref, comment faire ?

Si je n'ai pas pris la bonne méthode de résolution de mon problème, comment
puis-je procéder ?

J'attend vos lumières.

Je vous remerci si vous avez eu le courage de me lire :) Si je n'ai pas été
clair sur un point, dites le moi.

Toute remarque sera la bien venue.







Ps : j'ai voulu aussi le compiler sous dev-cpp pour voir. Résultat, même
problème, a part qu'il ne me reste plus que 5 ou 6 erreurs de linkage.

J'ai inclut dans les paramètres d'éditeur de lien :

C:/Python23/libs/libpython23.a

C:/DX90SDK/Lib/amstrmid.lib

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

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




Sauf erreur de ma part, il s'agit ici de cross_compilation. Il faut alors le préciser à la compilation.
"python setup.py build" ne suffit pas.
Il faut plutôt une commande du genre "python setup.py build compiler=mingw"
Je ne me souviens pas de la syntaxe exacte. Va voir sur le site python, le sujet y est abordé.

Nicolas

Avatar
Méta-MCI
Bonjour !

C'est hors-sujet ; et, surtout, ne le prend pas mal.

Mais, étais-tu obligé de citer tous le message original dans la réponse ?
Dans les newsgroup avec messages en HTML (je sais, ce n'est pas le cas ici),
toute citation inutile est mal vue.

En pratique, j'ai commencé par croire qu'il n'y avait que le message cité,
sans réponse...
Il m'a fallu lire une seconde fois le message, pour apercevoir ta réponse
(qui est d'ailleurs très judicieuse).

@+

Michel Claveau
Avatar
NicolasP
C'est hors-sujet ; et, surtout, ne le prend pas mal.

Si si ;)


Mais, étais-tu obligé de citer tous le message original dans la réponse ?
Dans les newsgroup avec messages en HTML (je sais, ce n'est pas le cas ici),
toute citation inutile est mal vue.

Effectivement, j'ai eu une petite (grosse ?) faiblesse. Mais je rentrais juste de vacances alors... j'étais pas encore chaud :)


En pratique, j'ai commencé par croire qu'il n'y avait que le message cité,
sans réponse...
Il m'a fallu lire une seconde fois le message, pour apercevoir ta réponse
(qui est d'ailleurs très judicieuse).
Je connais bien le problème car j'ai récemment eu ce genre de problème.


Nicolas

Avatar
Jérôme Le Bougeant
Sauf erreur de ma part, il s'agit ici de cross_compilation. Il faut alors
le préciser à la compilation.
"python setup.py build" ne suffit pas.
Il faut plutôt une commande du genre "python setup.py build
compiler=mingw"


Mon probleme a été réglé depuis un bon moment, mais je pense avoir dit que
j'utilisais le compilateur MinGW ? (bien sur en rajoutant l'option
"compiler=mingw")

Mais bon avec Python2.4 et Visual C++ 2005 Express je m'en sort.


Merci qd meme pour la reponse.