asdasfsdfdsf
Mitglied
hi leute, ich möchte eine klasse schreiben welche ein video lädt und abspielen kann. beim ccompilieren bekomme ich immer folgende fehlermeldung:
1>------ Build started: Project: blatt7Teil1, Configuration: Debug Win32 ------
1>Compiling...
1>VideoEngine.cpp
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(19) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(20) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(23) : error C2597: illegal reference to non-static member 'VideoEngine::video'
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(23) : error C2597: illegal reference to non-static member 'VideoEngine::frameNumber'
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(23) : error C2448: 'VideoEngine::run' : function-style initializer appears to be a function definition
1>Build log was saved at "file://c:\Users\..\Documents\Visual Studio 2008\Projects\blatt7Teil1\blatt7Teil1\Debug\BuildLog.htm"
1>blatt7Teil1 - 3 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
ich weiß leide rnicht was in meinem programm "static" ist und was nicht...
naja hier mein code:
...header:
...cpp:
und die main:
ich hoffe jemand weiss woran das liegt
1>------ Build started: Project: blatt7Teil1, Configuration: Debug Win32 ------
1>Compiling...
1>VideoEngine.cpp
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(19) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(20) : warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(23) : error C2597: illegal reference to non-static member 'VideoEngine::video'
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(23) : error C2597: illegal reference to non-static member 'VideoEngine::frameNumber'
1>c:\users\..\documents\visual studio 2008\projects\blatt7teil1\blatt7teil1\videoengine.cpp(23) : error C2448: 'VideoEngine::run' : function-style initializer appears to be a function definition
1>Build log was saved at "file://c:\Users\..\Documents\Visual Studio 2008\Projects\blatt7Teil1\blatt7Teil1\Debug\BuildLog.htm"
1>blatt7Teil1 - 3 error(s), 2 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
ich weiß leide rnicht was in meinem programm "static" ist und was nicht...
naja hier mein code:
...header:
Code:
#ifndef __VIDEOENGINE_H
#define __VIDEOENGINE_H
#include <iostream>
#include <opencv2/opencv.hpp>
class VideoEngine
{
public:
VideoEngine(void);
~VideoEngine(void);
cv::VideoCapture video;
cv::VideoCapture open(cv::VideoCapture video);
void run(cv::VideoCapture video);
int frameNumber;
private:
};
#endif
...cpp:
Code:
#include "VideoEngine.h"
using namespace cv;
using namespace std;
VideoEngine::VideoEngine(void)
{
}
VideoEngine::~VideoEngine(void)
{
}
int frameNumber;
VideoCapture video;
VideoCapture VideoEngine::open(VideoCapture video){
video.open("C:/Users/../Documents/Micro-dance.wmv");
int width = video.get(CV_CAP_PROP_FRAME_WIDTH);
int height = video.get(CV_CAP_PROP_FRAME_HEIGHT);
return video;
}
void VideoEngine::run(video,frameNumber){
while(true){
Mat videoFrame;
if (video.read(videoFrame) == false)
{
break;
}
frameNumber++;
waitKey(30);
}
}
und die main:
Code:
#include <string>
#include <vector>
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
void main(){
}
ich hoffe jemand weiss woran das liegt