-1

I am new to this kind of programming but am really interested in computer vision.

I have tried to follow this tutorial to but something must have changed between when this tutorial was made and when I tried following the instructions.

Tutorial Link: http://www.youtube.com/watch?v=cgo0UitHfp8

I get this error log, but I'm not sure how to fix it or what the problem even is.

------ Build started: Project: OpenCV_Project_001, Configuration: Debug Win32 ------

Main.cpp c:\documents and settings\lord cluckulon\my documents\visual studio 2010\projects\opencv_project_001\opencv_project_001\main.cpp(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\lord cluckulon\my documents\visual studio 2010\projects\opencv_project_001\opencv_project_001\main.cpp(7): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Here is the full code:

 #include<opencv\cv.h>
 #include <opencv\highgui.h>

using namespace cv; 


init ;main()
{

    //Create Matrix to store image
    Mat image;
    //initialize capture

    VideoCapture cap;
    cap.open(0);

    //create window to show image
    namedWindow("window",1);

    while(1)
    {

        //Copy webcam stream to image

        cap>>image;

        //print image to screen
        imshow("window",image);

        //delay 33ms
        waitKey(33);

    }




    return 0;
}

What is this "error C4430" and how can I fix what it is doing to my little file thing? ( using OpenCV249, Windows XP SP3, MS Visual C++ 2010 Express)

robbannn
  • 5,001
  • 1
  • 32
  • 47
GrimBot
  • 1
  • 1
  • 4
    What is `init;`? should this be a function call or a declaration... did you mean `int`? – EdChum Sep 22 '14 at 08:38
  • 2
    neither your compiler, nor i do know, what `init ;` is supposed to mean. ;) – berak Sep 22 '14 at 08:38
  • 3
    did you mean `int main() {......`? – EdChum Sep 22 '14 at 08:39
  • Hi [here you have the definition of your error](http://msdn.microsoft.com/en-us/library/ms173696.aspx). You have a typo up there: int main(){ as stated by others. – Stígandr Sep 22 '14 at 08:49
  • Thank you all! I have just run into a new situation where is is telling me that "msvcp120d.dll" is missing. I think I just have to reconfigure environmental variables in the control panel to fix it as mentioned here: http://stackoverflow.com/questions/21707992/msvcp120d-dll-missing – GrimBot Sep 22 '14 at 09:20
  • Additional Note is that I apparently need to build my own libraries since (from what I can gather) the files were compiled on a 64 bit system and don't work properly on my 32 bit system. For any future visitors to this thread, you can find info on it here, but be prepared to download a hand full of extra software to do it: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html – GrimBot Sep 22 '14 at 09:40

1 Answers1

1

Change init ;main() to int main(). To declare that function main are to return an int. The error is explained here.

robbannn
  • 5,001
  • 1
  • 32
  • 47
  • Thank you, that seems to have helped me past this part. I have just run into a new situation where is is telling me that "msvcp120d.dll" is missing. I think I just have to reconfigure environmental variables in the control panel to fix it as is covered in this thread: http://stackoverflow.com/questions/21707992/msvcp120d-dll-missing – GrimBot Sep 22 '14 at 09:16
  • Glad i could help solve your problem! – robbannn Sep 22 '14 at 11:25