Ask Your Question
-1

error before and when compile

asked 2013-04-03 23:57:24 -0600

updated 2013-04-04 04:09:50 -0600

hi, i use opencv 231 and c++ whith visual studio 2010. i use http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html tutotial. but cascadeClassifier face_cascade; and cascadeClassifier eyes_cascade; have a error and shown a red line below cascadeClassifier. after compile I get this error:

1>------ Build started: Project: faceRecognition, Configuration: Debug Win32 ------
1>Build started 04/04/2013 09:03:57 ق.ظ.
1>InitializeBuildStatus:
1>  Touching "Debug\faceRecognition.unsuccessfulbuild".
1>ClCompile:
1>  main.cpp
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(11): error C2146: syntax error : missing ';' before identifier 'face_cascade'
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(12): error C2146: syntax error : missing ';' before identifier 'eyes_cascade'
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(12): error C2086: 'int cascadeClassifier' : redefinition
1>          d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(11) : see declaration of 'cascadeClassifier'
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(18): error C2065: 'Cvcapture' : undeclared identifier
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(18): error C2065: 'capture' : undeclared identifier
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(21): error C2228: left of '.load' must have class/struct/union
1>          type is 'int'
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(22): error C2228: left of '.load' must have class/struct/union
1>          type is 'int'
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(25): error C2065: 'capture' : undeclared identifier
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(26): error C2065: 'capture' : undeclared identifier
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(30): error C2065: 'capture' : undeclared identifier
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(52): error C3861: 'equaliseHist': identifier not found
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(54): error C2228: left of '.detectMultiScale' must have class/struct/union
1>          type is 'int'
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(55): warning C4018: '<' : signed/unsigned mismatch
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(57): error C2065: 'point' : undeclared identifier
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(57): error C2146: syntax error : missing ';' before identifier 'center'
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(57): error C3861: 'center': identifier not found
1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(58): error C2065: 'center' : undeclared identifier
1>d ...
(more)
edit retag flag offensive close merge delete

Comments

I have for now update your post like 5 times. Please if you post code, use the code organizing button. Can you post the code also that you try to run? This error says nothing to me without the code generating the error.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-04 04:11:06 -0600 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2013-04-04 02:00:12 -0600

Ok some basic lessons in debugging.

  • Don't let yourself get overrun by the amount of errors. Mostly it is a waterfall effect of 1 error leading to tons of others.
  • Take the first error, and try to fix it. Post a question about that and people will help you out if you do not find it.
  • Format your error output if posting one with the code block tool.

So using these useful tips, lets see at your code.

error C2146: syntax error : missing ';' before identifier 'face_cascade' 1>d:\visual studio 2010\projects\facerecognition\facerecognition\main.cpp(11):

This clearly states that you have a command at line 11 or before that is not closed correctly. You have forgotten to place a ; sign, which does not close a command like it should on the rules above this error.

Fix it and report back :)

edit flag offensive delete link more

Comments

hi, thank you for your response. i resolve previous issue but I get another error . about ";" i check and all was ok, I have another problem : 'faceRecognition.exe': Loaded 'D:\Visual Studio 2010\Projects\faceRecognition\Debug\faceRecognition.exe', Symbols loaded. 'faceRecognition.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Opencv2.3\opencv\build\x86\vc9\bin\opencv_core231.dll', Cannot find or open the PDB file 'faceRecognition.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4974_none_509406

kaveh_dad gravatar imagekaveh_dad ( 2013-04-04 02:30:44 -0600 )edit

opencv_core231.dll is exist and i do related setting. some other of my program working correctly but 'faceRecognition.exe has error , of course i am beginner to opencv. cheers for advice

kaveh_dad gravatar imagekaveh_dad ( 2013-04-04 02:33:57 -0600 )edit

Not finding the PDB files is no error, it is due to using prebuilt libraries, who do not contain the debug information files. If this is the only output, then it should work. Focus on lines with error in it. Please only post these lines.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-04 02:55:49 -0600 )edit

hi, StevenPuttemans First-chance exception at 0x75379617 in faceRecognition.exe: Microsoft C++ exception: cv::Exception at memory location 0x0026f2e8.. Unhandled exception at 0x75379617 in faceRecognition.exe: Microsoft C++ exception: cv::Exception at memory location 0x0026f2e8.. faceRecognition.exe has triggered a breakpoint

kaveh_dad gravatar imagekaveh_dad ( 2013-04-04 03:27:56 -0600 )edit

dude, post your code in original post, and do some effort, this is not a solve my debug problem forum ...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-04 03:37:16 -0600 )edit

Question Tools

Stats

Asked: 2013-04-03 23:57:24 -0600

Seen: 1,699 times

Last updated: Apr 04 '13