Précédent   Forum des professionnels en informatique > C et C++ > Bibliothèques > OpenCV
OpenCV Vos questions sur l'API de traitement d'images OpenCV.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 28/01/2012, 18h23   #1
Invité de passage
 
Inscription : décembre 2008
Messages : 6
Détails du profil
Informations forums :
Inscription : décembre 2008
Messages : 6
Points : 1
Points : 1
Par défaut erreur de compilation opencv1.1 + visual studio 2008 + vista

bonjour
voila j'ai un projet à développer avec opencv et j'ai un problème des erreurs de compilation que j'arrive pas à trouver une solution pour compiler le code
j'ai installer la version 1.1 de opencv avec microsoft visual studion 2008 sous vista , le programme que j'ai essayé c'est a sample code pour la detection de mouvement motempl.c .j'ai ajouté les include, lib, linkers , src , les .dll au systeme32
quand je debug le programme voici la liste d'erreur :

1>Compiling...
1>main.cpp
1>c:\program files\opencv\otherlibs\highgui\highgui.h(347) : error C2065: 'HWND' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(347) : error C2065: 'UINT' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(347) : error C2065: 'WPARAM' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(347) : error C2065: 'LPARAM' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(347) : error C2062: type 'int' unexpected
1>c:\program files\opencv\otherlibs\highgui\highgui.h(348) : error C2065: 'CvWin32WindowCallback' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(348) : error C2146: syntax error : missing ')' before identifier 'on_preprocess'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(348) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\opencv\otherlibs\highgui\highgui.h(348) : error C2182: 'cvSetPreprocessFuncWin32' : illegal use of type 'void'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(348) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(349) : error C2065: 'CvWin32WindowCallback' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(349) : error C2146: syntax error : missing ')' before identifier 'on_postprocess'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(349) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files\opencv\otherlibs\highgui\highgui.h(349) : error C2182: 'cvSetPostprocessFuncWin32' : illegal use of type 'void'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(349) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(370) : error C2146: syntax error : missing ';' before identifier 'NormalizeRect'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(370) : error C2433: 'RECT' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(370) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(370) : error C2146: syntax error : missing ')' before identifier 'r'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(370) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(370) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C2146: syntax error : missing ';' before identifier 'NormalizeRect'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C2433: 'RECT' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C2086: 'int RECT' : redefinition
1> c:\program files\opencv\otherlibs\highgui\highgui.h(370) : see declaration of 'RECT'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C2146: syntax error : missing ')' before identifier 'r'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C2374: 'NormalizeRect' : redefinition; multiple initialization
1> c:\program files\opencv\otherlibs\highgui\highgui.h(370) : see declaration of 'NormalizeRect'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(371) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(372) : error C2143: syntax error : missing ';' before '{'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(372) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files\opencv\otherlibs\highgui\highgui.h(392) : error C2146: syntax error : missing ')' before identifier 'sr'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(392) : error C2433: 'RectToCvRect' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(392) : error C2440: 'initializing' : cannot convert from 'int' to 'CvRect'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\program files\opencv\otherlibs\highgui\highgui.h(392) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(393) : error C2146: syntax error : missing ')' before identifier 'sr'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(393) : error C2433: 'RectToCvRect' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(393) : error C2374: 'RectToCvRect' : redefinition; multiple initialization
1> c:\program files\opencv\otherlibs\highgui\highgui.h(392) : see declaration of 'RectToCvRect'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(393) : error C2440: 'initializing' : cannot convert from 'int' to 'CvRect'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\program files\opencv\otherlibs\highgui\highgui.h(393) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(394) : error C2143: syntax error : missing ';' before '{'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(394) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files\opencv\otherlibs\highgui\highgui.h(399) : error C2146: syntax error : missing ';' before identifier 'CvRectToRect'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(399) : error C2433: 'RECT' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(399) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(399) : error C2086: 'int RECT' : redefinition
1> c:\program files\opencv\otherlibs\highgui\highgui.h(370) : see declaration of 'RECT'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(399) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(400) : error C2146: syntax error : missing ';' before identifier 'CvRectToRect'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(400) : error C2433: 'RECT' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(400) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(400) : error C2086: 'int RECT' : redefinition
1> c:\program files\opencv\otherlibs\highgui\highgui.h(370) : see declaration of 'RECT'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(401) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\opencv\otherlibs\highgui\highgui.h(402) : error C2146: syntax error : missing ';' before identifier 'dr'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(402) : error C2065: 'dr' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(403) : error C2065: 'dr' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(403) : error C2228: left of '.left' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(404) : error C2065: 'dr' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(404) : error C2228: left of '.top' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(405) : error C2065: 'dr' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(405) : error C2228: left of '.right' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(406) : error C2065: 'dr' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(406) : error C2228: left of '.bottom' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(408) : error C2065: 'dr' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(411) : error C2146: syntax error : missing ')' before identifier 'r'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(411) : error C2433: 'RectToROI' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(411) : error C2440: 'initializing' : cannot convert from 'int' to 'IplROI'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\program files\opencv\otherlibs\highgui\highgui.h(411) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(412) : error C2146: syntax error : missing ')' before identifier 'r'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(412) : error C2433: 'RectToROI' : 'inline' not permitted on data declarations
1>c:\program files\opencv\otherlibs\highgui\highgui.h(412) : error C2374: 'RectToROI' : redefinition; multiple initialization
1> c:\program files\opencv\otherlibs\highgui\highgui.h(411) : see declaration of 'RectToROI'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(412) : error C2440: 'initializing' : cannot convert from 'int' to 'IplROI'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\program files\opencv\otherlibs\highgui\highgui.h(412) : error C2059: syntax error : ')'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(413) : error C2143: syntax error : missing ';' before '{'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(413) : error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files\opencv\otherlibs\highgui\highgui.h(455) : error C2061: syntax error : identifier 'RECT'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(484) : error C2061: syntax error : identifier 'HDC'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(487) : error C2061: syntax error : identifier 'HDC'
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2065: 'r' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2228: left of '.left' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2065: 'r' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2228: left of '.top' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2065: 'r' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2228: left of '.right' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2065: 'r' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2228: left of '.left' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2065: 'r' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2228: left of '.bottom' must have class/struct/union
1> type is ''unknown-type''
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2065: 'r' : undeclared identifier
1>c:\program files\opencv\otherlibs\highgui\highgui.h(458) : error C2228: left of '.top' must have class/struct/union
1> type is ''unknown-type''
1>premier_test - 87 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========

que dois je faire?
Merci pour votre aide
univers est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/01/2012, 11h17   #2
Membre éprouvé
 
Homme
Chercheur en informatique
Inscription : avril 2008
Messages : 272
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Royaume-Uni

Informations professionnelles :
Activité : Chercheur en informatique

Informations forums :
Inscription : avril 2008
Messages : 272
Points : 451
Points : 451
Essaye d'inclure windows.h
math_lab est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/01/2012, 18h51   #3
Invité de passage
 
Inscription : décembre 2008
Messages : 6
Détails du profil
Informations forums :
Inscription : décembre 2008
Messages : 6
Points : 1
Points : 1
j'ai crée un fichier fictif windows.h et j'ai compilé mais tjrs le meme probleme
je bloque !!!
univers est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 31/01/2012, 11h18   #4
Membre éprouvé
 
Homme
Chercheur en informatique
Inscription : avril 2008
Messages : 272
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : Royaume-Uni

Informations professionnelles :
Activité : Chercheur en informatique

Informations forums :
Inscription : avril 2008
Messages : 272
Points : 451
Points : 451
Heu non, il faut pas créer de fichier windows.h, juste l'inclure avant d'inclure highgui.h (c'est un fichier qui existe déjà et est fourni par le compilateur). Mais franchement, pourquoi utiliser opencv 1.1 ? C'est vraiment chercher les emmerdes que de commencer avec une vieille version qui n'est plus supportée.
math_lab est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/02/2012, 18h49   #5
Invité de passage
 
Inscription : décembre 2008
Messages : 6
Détails du profil
Informations forums :
Inscription : décembre 2008
Messages : 6
Points : 1
Points : 1
bein j'avais lu ça sur internet !!!!!
c'est bon j'ai résolu le problème en enlevant ce windows.h
merci pour votre aide
univers est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 17h16.


 
 
 
 
Partenaires

Hébergement Web