Running object track code on visual c++ with open CV

Dear all,
I am newbie to config the open CV in visual c++.
i have visual studio 2013 desktop version & open CV beta v3.0; I have config the data as per link shared 
Config opencv I have downloaded the example code from youtube ; link for the code as followyoutube
link
visual c++ code
#include <sstream>
#include <string>
#include <iostream>
#include <opencv\highgui.h>
#include <opencv\cv.h>
using namespace cv;
//initial min and max HSV filter values.
//these will be changed using trackbars
int H_MIN = 0;
int H_MAX = 256;
int S_MIN = 0;
int S_MAX = 256;
int V_MIN = 0;
int V_MAX = 256;
//default capture width and height
const int FRAME_WIDTH = 640;
const int FRAME_HEIGHT = 480;
//max number of objects to be detected in frame
const int MAX_NUM_OBJECTS=50;
//minimum and maximum object area
const int MIN_OBJECT_AREA = 20*20;
const int MAX_OBJECT_AREA = FRAME_HEIGHT*FRAME_WIDTH/1.5;
//names that will appear at the top of each window
const string windowName = "Original Image";
const string windowName1 = "HSV Image";
const string windowName2 = "Thresholded Image";
const string windowName3 = "After Morphological Operations";
const string trackbarWindowName = "Trackbars";
void on_trackbar( int, void* )
{//This function gets called whenever a
// trackbar position is changed
string intToString(int number){
std::stringstream ss;
ss << number;
return ss.str();
void createTrackbars(){
//create window for trackbars
namedWindow(trackbarWindowName,0);
//create memory to store trackbar name on window
char TrackbarName[50];
sprintf( TrackbarName, "H_MIN", H_MIN);
sprintf( TrackbarName, "H_MAX", H_MAX);
sprintf( TrackbarName, "S_MIN", S_MIN);
sprintf( TrackbarName, "S_MAX", S_MAX);
sprintf( TrackbarName, "V_MIN", V_MIN);
sprintf( TrackbarName, "V_MAX", V_MAX);
//create trackbars and insert them into window
//3 parameters are: the address of the variable that is changing when the trackbar is moved(eg.H_LOW),
//the max value the trackbar can move (eg. H_HIGH),
//and the function that is called whenever the trackbar is moved(eg. on_trackbar)
// ----> ----> ---->
createTrackbar( "H_MIN", trackbarWindowName, &H_MIN, H_MAX, on_trackbar );
createTrackbar( "H_MAX", trackbarWindowName, &H_MAX, H_MAX, on_trackbar );
createTrackbar( "S_MIN", trackbarWindowName, &S_MIN, S_MAX, on_trackbar );
createTrackbar( "S_MAX", trackbarWindowName, &S_MAX, S_MAX, on_trackbar );
createTrackbar( "V_MIN", trackbarWindowName, &V_MIN, V_MAX, on_trackbar );
createTrackbar( "V_MAX", trackbarWindowName, &V_MAX, V_MAX, on_trackbar );
void drawObject(int x, int y,Mat &frame){
//use some of the openCV drawing functions to draw crosshairs
//on your tracked image!
//UPDATE:JUNE 18TH, 2013
//added 'if' and 'else' statements to prevent
//memory errors from writing off the screen (ie. (-25,-25) is not within the window!)
circle(frame,Point(x,y),20,Scalar(0,255,0),2);
if(y-25>0)
line(frame,Point(x,y),Point(x,y-25),Scalar(0,255,0),2);
else line(frame,Point(x,y),Point(x,0),Scalar(0,255,0),2);
if(y+25<FRAME_HEIGHT)
line(frame,Point(x,y),Point(x,y+25),Scalar(0,255,0),2);
else line(frame,Point(x,y),Point(x,FRAME_HEIGHT),Scalar(0,255,0),2);
if(x-25>0)
line(frame,Point(x,y),Point(x-25,y),Scalar(0,255,0),2);
else line(frame,Point(x,y),Point(0,y),Scalar(0,255,0),2);
if(x+25<FRAME_WIDTH)
line(frame,Point(x,y),Point(x+25,y),Scalar(0,255,0),2);
else line(frame,Point(x,y),Point(FRAME_WIDTH,y),Scalar(0,255,0),2);
putText(frame,intToString(x)+","+intToString(y),Point(x,y+30),1,1,Scalar(0,255,0),2);
void morphOps(Mat &thresh){
//create structuring element that will be used to "dilate" and "erode" image.
//the element chosen here is a 3px by 3px rectangle
Mat erodeElement = getStructuringElement( MORPH_RECT,Size(3,3));
//dilate with larger element so make sure object is nicely visible
Mat dilateElement = getStructuringElement( MORPH_RECT,Size(8,8));
erode(thresh,thresh,erodeElement);
erode(thresh,thresh,erodeElement);
dilate(thresh,thresh,dilateElement);
dilate(thresh,thresh,dilateElement);
void trackFilteredObject(int &x, int &y, Mat threshold, Mat &cameraFeed){
Mat temp;
threshold.copyTo(temp);
//these two vectors needed for output of findContours
vector< vector<Point> > contours;
vector<Vec4i> hierarchy;
//find contours of filtered image using openCV findContours function
findContours(temp,contours,hierarchy,CV_RETR_CCOMP,CV_CHAIN_APPROX_SIMPLE );
//use moments method to find our filtered object
double refArea = 0;
bool objectFound = false;
if (hierarchy.size() > 0) {
int numObjects = hierarchy.size();
//if number of objects greater than MAX_NUM_OBJECTS we have a noisy filter
if(numObjects<MAX_NUM_OBJECTS){
for (int index = 0; index >= 0; index = hierarchy[index][0]) {
Moments moment = moments((cv::Mat)contours[index]);
double area = moment.m00;
//if the area is less than 20 px by 20px then it is probably just noise
//if the area is the same as the 3/2 of the image size, probably just a bad filter
//we only want the object with the largest area so we safe a reference area each
//iteration and compare it to the area in the next iteration.
if(area>MIN_OBJECT_AREA && area<MAX_OBJECT_AREA && area>refArea){
x = moment.m10/area;
y = moment.m01/area;
objectFound = true;
refArea = area;
}else objectFound = false;
//let user know you found an object
if(objectFound ==true){
putText(cameraFeed,"Tracking Object",Point(0,50),2,1,Scalar(0,255,0),2);
//draw object location on screen
drawObject(x,y,cameraFeed);}
}else putText(cameraFeed,"TOO MUCH NOISE! ADJUST FILTER",Point(0,50),1,2,Scalar(0,0,255),2);
int main(int argc, char* argv[])
//some boolean variables for different functionality within this
//program
bool trackObjects = false;
bool useMorphOps = false;
//Matrix to store each frame of the webcam feed
Mat cameraFeed;
//matrix storage for HSV image
Mat HSV;
//matrix storage for binary threshold image
Mat threshold;
//x and y values for the location of the object
int x=0, y=0;
//create slider bars for HSV filtering
createTrackbars();
//video capture object to acquire webcam feed
VideoCapture capture;
//open capture object at location zero (default location for webcam)
capture.open(0);
//set height and width of capture frame
capture.set(CV_CAP_PROP_FRAME_WIDTH,FRAME_WIDTH);
capture.set(CV_CAP_PROP_FRAME_HEIGHT,FRAME_HEIGHT);
//start an infinite loop where webcam feed is copied to cameraFeed matrix
//all of our operations will be performed within this loop
while(1){
//store image to matrix
capture.read(cameraFeed);
//convert frame from BGR to HSV colorspace
cvtColor(cameraFeed,HSV,COLOR_BGR2HSV);
//filter HSV image between values and store filtered image to
//threshold matrix
inRange(HSV,Scalar(H_MIN,S_MIN,V_MIN),Scalar(H_MAX,S_MAX,V_MAX),threshold);
//perform morphological operations on thresholded image to eliminate noise
//and emphasize the filtered object(s)
if(useMorphOps)
morphOps(threshold);
//pass in thresholded frame to our object tracking function
//this function will return the x and y coordinates of the
//filtered object
if(trackObjects)
trackFilteredObject(x,y,threshold,cameraFeed);
//show frames
imshow(windowName2,threshold);
imshow(windowName,cameraFeed);
imshow(windowName1,HSV);
//delay 30ms so that screen can refresh.
//image will not appear without this waitKey() command
waitKey(30);
return 0;
For above code i config as per in video. But didnt get OPENCV_DEBUG243 file.
error i am getting as below. Let me know how can solve the issue. What are additional info i need to include here.
1>------ Build started: Project: ObjectTrackingTest, Configuration: Debug Win32 ------
1> ObjectTrackingTest.cpp
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(29): error C2039: 'swprintf' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(29): error C2873: 'swprintf' : symbol cannot be used in a using-declaration
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(30): error C2039: 'vswprintf' : is not a member of '`global namespace''
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar(30): error C2873: 'vswprintf' : symbol cannot be used in a using-declaration
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(38): warning C4244: 'initializing' : conversion from 'double' to 'const int', possible loss of data
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40): error C2146: syntax error : missing ';' before identifier 'windowName'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40): error C2440: 'initializing' : cannot convert from 'const char [15]' to 'int'
1> There is no context in which this conversion is possible
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(41): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(41): error C2146: syntax error : missing ';' before identifier 'windowName1'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(41): error C2086: 'const int string' : redefinition
1> c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40) : see declaration of 'string'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(41): error C2440: 'initializing' : cannot convert from 'const char [10]' to 'int'
1> There is no context in which this conversion is possible
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(42): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(42): error C2146: syntax error : missing ';' before identifier 'windowName2'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(42): error C2086: 'const int string' : redefinition
1> c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40) : see declaration of 'string'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(42): error C2440: 'initializing' : cannot convert from 'const char [18]' to 'int'
1> There is no context in which this conversion is possible
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(43): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(43): error C2146: syntax error : missing ';' before identifier 'windowName3'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(43): error C2086: 'const int string' : redefinition
1> c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40) : see declaration of 'string'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(43): error C2440: 'initializing' : cannot convert from 'const char [31]' to 'int'
1> There is no context in which this conversion is possible
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(44): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(44): error C2146: syntax error : missing ';' before identifier 'trackbarWindowName'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(44): error C2086: 'const int string' : redefinition
1> c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40) : see declaration of 'string'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(44): error C2440: 'initializing' : cannot convert from 'const char [10]' to 'int'
1> There is no context in which this conversion is possible
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(54): error C2146: syntax error : missing ';' before identifier 'intToString'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(54): error C2373: 'string' : redefinition; different type modifiers
1> c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(40) : see declaration of 'string'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(59): error C2440: 'return' : cannot convert from 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' to 'int'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(60): error C2617: 'intToString' : inconsistent return statement
1> c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(54) : see declaration of 'intToString'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(65): error C3861: 'namedWindow': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(79): error C3861: 'createTrackbar': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(80): error C3861: 'createTrackbar': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(81): error C3861: 'createTrackbar': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(82): error C3861: 'createTrackbar': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(83): error C3861: 'createTrackbar': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(84): error C3861: 'createTrackbar': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(97): error C3861: 'circle': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(99): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(100): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(102): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(103): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(105): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(106): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(108): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(109): error C3861: 'line': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(111): error C3861: 'putText': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(119): error C2065: 'MORPH_RECT' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(119): error C3861: 'getStructuringElement': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(121): error C2065: 'MORPH_RECT' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(121): error C3861: 'getStructuringElement': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(123): error C3861: 'erode': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(124): error C3861: 'erode': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(127): error C3861: 'dilate': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(128): error C3861: 'dilate': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(138): error C2065: 'vector' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(138): error C2059: syntax error : '>'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(139): error C2065: 'vector' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(139): error C2275: 'cv::Vec4i' : illegal use of this type as an expression
1> h:\softwares\opencv\build\include\opencv2\core\matx.hpp(357) : see declaration of 'cv::Vec4i'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(139): error C2065: 'hierarchy' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(141): error C2065: 'contours' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(141): error C2065: 'hierarchy' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(141): error C3861: 'findContours': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(145): error C2065: 'hierarchy' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(145): error C2228: left of '.size' must have class/struct/union
1> type is 'unknown-type'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(146): error C2065: 'hierarchy' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(146): error C2228: left of '.size' must have class/struct/union
1> type is 'unknown-type'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(149): error C2065: 'hierarchy' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(151): error C2065: 'contours' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(151): error C3861: 'moments': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(159): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(160): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(170): error C3861: 'putText': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(176): error C3861: 'putText': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(196): error C2065: 'VideoCapture' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(196): error C2146: syntax error : missing ';' before identifier 'capture'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(196): error C2065: 'capture' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(198): error C2065: 'capture' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(198): error C2228: left of '.open' must have class/struct/union
1> type is 'unknown-type'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(200): error C2065: 'capture' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(200): error C2228: left of '.set' must have class/struct/union
1> type is 'unknown-type'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(201): error C2065: 'capture' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(201): error C2228: left of '.set' must have class/struct/union
1> type is 'unknown-type'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(206): error C2065: 'capture' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(206): error C2228: left of '.read' must have class/struct/union
1> type is 'unknown-type'
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(208): error C2065: 'COLOR_BGR2HSV' : undeclared identifier
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(208): error C3861: 'cvtColor': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(223): error C3861: 'imshow': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(224): error C3861: 'imshow': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(225): error C3861: 'imshow': identifier not found
1>c:\users\user\documents\visual studio 2013\projects\objecttrackingtest\objecttrackingtest\objecttrackingtest.cpp(230): error C3861: 'waitKey': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
AMPS12

// cwchar standard header
#pragma once
#ifndef _CWCHAR_
#define _CWCHAR_
#include <yvals.h>
#ifdef _STD_USING
#undef _STD_USING
#include <wchar.h>
#define _STD_USING
#else /* _STD_USING */
#include <wchar.h>
#endif /* _STD_USING */
typedef mbstate_t _Mbstatet;
#if _GLOBAL_USING && !defined(RC_INVOKED)
_STD_BEGIN
using _CSTD _Mbstatet;
using _CSTD mbstate_t; using _CSTD size_t; using _CSTD tm; using _CSTD wint_t;
using _CSTD btowc; using _CSTD fgetwc; using _CSTD fgetws; using _CSTD fputwc;
using _CSTD fputws; using _CSTD fwide; using _CSTD fwprintf;
using _CSTD fwscanf; using _CSTD getwc; using _CSTD getwchar;
using _CSTD mbrlen; using _CSTD mbrtowc; using _CSTD mbsrtowcs;
using _CSTD mbsinit; using _CSTD putwc; using _CSTD putwchar;using _CSTD swprintf; using _CSTD swscanf; using _CSTD ungetwc;
using _CSTD vfwprintf; using _CSTD vswprintf; using _CSTD vwprintf;
using _CSTD wcrtomb; using _CSTD wprintf; using _CSTD wscanf;
using _CSTD wcsrtombs; using _CSTD wcstol; using _CSTD wcscat;
using _CSTD wcschr; using _CSTD wcscmp; using _CSTD wcscoll;
using _CSTD wcscpy; using _CSTD wcscspn; using _CSTD wcslen;
using _CSTD wcsncat; using _CSTD wcsncmp; using _CSTD wcsncpy;
using _CSTD wcspbrk; using _CSTD wcsrchr; using _CSTD wcsspn;
using _CSTD wcstod; using _CSTD wcstoul; using _CSTD wcsstr;
using _CSTD wcstok; using _CSTD wcsxfrm; using _CSTD wctob;
using _CSTD wmemchr; using _CSTD wmemcmp; using _CSTD wmemcpy;
using _CSTD wmemmove; using _CSTD wmemset; using _CSTD wcsftime;
using _CSTD vfwscanf; using _CSTD vswscanf; using _CSTD vwscanf;
using _CSTD wcstof; using _CSTD wcstold;
using _CSTD wcstoll; using _CSTD wcstoull;
_STD_END
#endif /* _GLOBAL_USING */
#endif /* _CWCHAR_ */
* Copyright (c) 1992-2013 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
V6.40:0009 */
this is line where it go when i clicked
AMPS12

Similar Messages

  • Which is the tracking code for my macbook with tnt

    well which code is it i cnt track with tnt even though apple is showing it has left
    w7*****
    or
    80******
    thanks in advance

    Gareth if you click the link in your despatch email for the order status
    Put in the web order reference number, which is W****** and the shipping address postcode and click find order.
    Then click track this shipment.
    On the following screen it's the carrier tracking number that you can use on tnt.
    Hope this helps.

  • Problem with Embedded Event Manager and Object Tracking

    Hi,
    I have a 2801 running c2801-advipservicesk9-mz.124-24.T2.bin. It has the following configuration:
    track 300 list boolean or
    object 10
    object 11
    object 12
    object 13
    event manager applet clear_ipsec_tunnel
    event track 300 state down
    action 1.0 cli command "enable"
    action 2.0 cli command "clear crypto session"
    action 3.0 syslog msg "IPSec tunnel has been cleared by clear_ipsec_tunnel applet"
    My problem is that after the tracked object number 300 transitions from an up state to a down state, nothing happens. It seems like the applet doesn't work with object tracking. Here's what I see in logs:
    Dec  7 21:52:32.236 MCK: %TRACKING-5-STATE: 12 ip sla 12 reachability Up->Down
    Dec  7 21:52:37.236 MCK: %TRACKING-5-STATE: 13 ip sla 13 reachability Up->Down
    Dec  7 21:52:57.236 MCK: %TRACKING-5-STATE: 10 ip sla 10 reachability Up->Down
    Dec  7 21:53:07.236 MCK: %TRACKING-5-STATE: 11 ip sla 11 reachability Up->Down
    Dec  7 21:53:07.996 MCK: %TRACKING-5-STATE: 300 list boolean or Up->Down
    That's it. For some reason, the applet won't execute the CLI commands when the EEM applet is triggered. Am I doing something wrong or I have encountered some bug? Thanks.

    jclarke,
    Today I added the router into the tacacs server database and the applet started working just fine by using my login name. So the working configuration looks like this:
    event manager session cli username "my login name"
    event manager applet clear_ipsec_tunnel
    event track 300 state down maxrun 30
    action 1.0 cli command "enable"
    action 2.0 cli command "clear crypto session"
    action 3.0 syslog msg "IPSec tunnel has been cleared by clear_ipsec_tunnel applet"
    Then I tried to use a login name from the local database that has "privelege 15" access and of course the debug output showed me this:
    Dec  8 18:12:58.203 MCK: %TRACKING-5-STATE: 300 list boolean or Up->Down
    Dec  8 18:12:58.203 MCK: fh_track_object_changed: Track notification 300 state down
    Dec  8 18:12:58.203 MCK: fh_fd_track_event_match: track ED pubinfo enqueue rc = 0
    Dec  8 18:12:58.215 MCK: fh_send_track_fd_msg: msg_type=64
    Dec  8 18:12:58.215 MCK: fh_send_track_fd_msg: sval=0
    Dec  8 18:12:58.219 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : CTL : cli_open called.
    Dec  8 18:12:58.227 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT : Router>
    Dec  8 18:12:58.227 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : IN  : Router>enable
    Dec  8 18:12:58.747 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT : Command authorization failed.
    Dec  8 18:12:58.747 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT :
    Dec  8 18:12:58.747 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT : Router>
    Dec  8 18:12:58.747 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : IN  : Router>clear crypto session
    Dec  8 18:12:58.771 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT :                                  ^
    Dec  8 18:12:58.771 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT : % Invalid input detected at '^' marker.
    Dec  8 18:12:58.771 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT :
    Dec  8 18:12:58.771 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : OUT : Router>
    Dec  8 18:12:58.775 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel: IPSec tunnel has been cleared by clear_ipsec_tunnel  applet
    Dec  8 18:12:58.775 MCK: %HA_EM-6-LOG: clear_ipsec_tunnel : DEBUG(cli_lib) : : CTL : cli_close called.
    So I guess this problem arises when you have command authorization enabled and the tacacs server is not reachable or something like that. I have tried to find a way to use the local database instead of using the aaa server but didn't succeed. Although I have found an interesting workaround. Here it is:
    Link: http://blog.ioshints.info/2007/05/command-authorization-fails-with-eem.html
    Workaround found after reading the "Executing IOS commands from Tcl shell" from the "Tclsh on Cisco IOS tutorial".
    On the above article it is mentionned that the ios_config command is executed inside the context of another VTY line (also found with the AAA debug). The workaround is to define the FIRST VTY line with "transport input none" to prevent ssh or telnet to grab it and to configure the aaa authorization without any command authorization for this line.
    Kind regards
    Christian Chautems
    Looks great, but I am not quite sure how to "configure the aaa authorization without any command authorization for this line".
    Anyway, jclarke thank you so much for taking your time to look into my problem and for your help.

  • How can I print the "number lines" with the code in Visual Studio?

    How can I print the "number lines" with the code in Visual Studio?

    Hi BillionaireMan,
    What about your issue now?
    If you have resolved it, you can share the solution here, which will be beneficial for other members with the same issue.
    If you did not, please tell us more information,we will try my best to help you.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Running the same code multiple times with different paramters automatica​lly

    Hi guys,
    I want to run the same code multiple times with different paramters automatically. Actually, I am doing some sample scans which takes around 2 hours n then I have to be there to change the paramters and run it again. Mostly I do use folowing paramters only
    X_Intial, X_Final, X-StepSize
    Y_Intial, Y_Final, Y-StepSize
       Thanks,
    Dushyant

    All you have to di is put all of the parameters for each run into a cluster array. Surround your main program with a for loop and wire the cluster array through the for loop. A for loop will autoindex an input array so inside the for loop you just have to unbundle the cluster to get the parameters for each run.
    Message Edited by Dennis Knutson on 07-13-2006 07:50 AM
    Attachments:
    Cluster Array.JPG ‏9 KB

  • Show-stopping error when I try to load/run the muse code with JQuery version 1.9.1.

    Version 1.9.1, and the muse code uses 1.8.3.  As you can see HERE,http://jquery.com/download/ version 1.9.0 was a major milestone release for JQuery that eliminated much of the (deprecated) functionality of earlier versions. Unfortunately, the muse html uses some of that deprecated functionality (specifically, the "browser( )" function HERE)http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed. Thus I am getting a show-stopping error when I try to load/run the muse code with version 1.9.1. Other people have had this same problem (see THIS)http://bugs.jquery.com/ticket/13214.
    Do you see an update in the near future?

    Version 1.9.1, and the muse code uses 1.8.3.  As you can see HERE,http://jquery.com/download/ version 1.9.0 was a major milestone release for JQuery that eliminated much of the (deprecated) functionality of earlier versions. Unfortunately, the muse html uses some of that deprecated functionality (specifically, the "browser( )" function HERE)http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed. Thus I am getting a show-stopping error when I try to load/run the muse code with version 1.9.1. Other people have had this same problem (see THIS)http://bugs.jquery.com/ticket/13214.
    Do you see an update in the near future?

  • Is it possible to import Tracking Codes with Cisco WebEx Meetings Server 2.5?

    Is it possible to import Tracking Codes with Cisco WebEx Meetings Server 2.5?

    Hi,
    In documentation, you can find only what is possible and supported in the product. We don't document what is not supported. 
    At this time, there is no feature request submitted for this as I assume no one requested such a feature. If your customer really needs this feature, I advise you to reach out to your/their Cisco Account Manager, explain the feature you would like to see, so they can reach out to Product Management and see if this could be built in the next product version.
    I hope this helps.
    -Dejan

  • Getting 'File not found' error while using server object model code

    Hi,
    I am using server object model code to pull list data in a console application. My machine has standalone installation of SP 2010. I am getting error 'File Not Found', however the same operation is working fine with client object model code.
    Code I am using:
    string strURL=http://servername/sites/sitename;
    SPSite siteObj=new SPSite (strURL); //getting error here.
    I have already checked the below,
    1. Framework being used is 3.5.
    2. I have proper access to site.
    3. Running visual studio as admin.
    Any help is much appreciated.
    thanks
    Tarique
    thanks and regards Tarique Aslam

    Hello Tarique ,
    Couple of pints need to check:
    1. User running the console application needs to have at least read permission to the SharePoint databases
    2. Set application by changing the "Platform target:" option on the "Build" to "Any CPU"
    Also refer this similar thread:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2a419663-c6bc-4f6f-841b-75aeb9dd053d/spsite-file-not-found
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Run block of code periodically

    Hello,
    I am writing a program which controls the temperature in a room. The user enters the "Start Temp", and "Goal Temp". First the program checks the "Cur Temp". THe program compares this temp with the "Start Temp"; if (Cur Temp < Start Temp) then I turn  on heaters. Once the StartTemp has been reached I am ready to move on to the next portion of my code which is cooling the room down at a user defined rate of cooling. I would like to compare the temperatures periodically. This is where I run into a problem. I have tried setting a delay before the cooling down portion of my code but it delays the hole while loop (all code in one while loop). I would like the temperature comparions to only occur every x amount of seconds (configurable by the user). So for arguments sake, I set the comparison rate at 10 seconds, every ten seconds I want to compare the previous value with the current value and determine the rate of at which it is cooling. If that rate is within in the desired rate of cooling then everything is ok. Ideally this code would not interfer with other program funcitons I have going on. Does anyone have any ideas on how I can have this code run perioically?
    Thanks

    There are plenty solutions possible, and they depend a little bit on what else the code does.
    rchaoua wrote:
    Once the StartTemp has been reached I am ready to move on to the next portion of my code which is cooling the room down at a user defined rate of cooling.
    Well, the right thing is to do all in the same portion of code using a state machine architecture. There should only be one main loop with a case structure that depends on the state.
    Here are some possibilities:
    You can place your periodic code inside another case and only activate it whenever the loop counters is an integer multiple of some number or if a certain time has elapsed
    for every 10th iteration, you would divide [i] by 10 using "quotient&remainder" and check if the remainder is zero.
    Use the "elapsed time" express VI.
    Do your own time tracking (e.g. using tick count and a shift register.
    You can also place your slow periodic code in its seperate, parallel while loop.
    LabVIEW Champion . Do more with less code and in less time .

  • How to run a .bat code?

    how to run a .bat code?
    I have a code ,batch (.bat) in richtextbox1, and want , to text(code .bat) in richtextbox1 it was launched in the console cmd
    without the use of saving a file with this code and run it

    In your code, right-click on the word "Desktop". In the context menu, select "go to definition". The object browser opens. You will see other members of the SpecialFolder enum. You can examine these values and read the description below.
    One of them is "ProgramFiles". If you pass this value to GetFolderPath, it returns the path of the program files.
    Another way: In your code, move the caret to the word "desktop" and press Ctr+J. It will open the same list of enum values. Whenever you select an item in the list, the tooltip should also show a description of the enum value.
    Then look at
    System.IO.Path.Combine to combine the program files path with the sub folder path. The result will be the full path of the directory. You can call Path.Combine for every path name or file name that you want to add.
    Armin

  • "Track 2 is controlled by stereo object track 1-2" - why?

    As i want to record in mono or stereo on track 1, 2 , 3 and so forth, i've got this problem that "trac 2 is controlled by stereo object track 1-2".
    Same message on track four, six and so on.
    Logic started acting strange in this way after an update.
    I'm using the Edirol FA66 Firewire converter, and i've also got very low input to logic from the unit. If i use the "line in" on my mac -through a mixer, the signal is ok.
    Any suggestions?
    Thanks
    Mac 2.33 Ghz Intel Core 2 Duo   Mac OS X (10.4.10)   Running Logic Pro 7.2.3, Edirol FA66

    You have Universal Track mode turned off in your audio preferences.
    I suggest enabling UTM, as this is the way most people use Logic, aside for those with specific reason to turn it off (mostly for old hardware support).

  • Urgent: please help - Object Hash Code of RMI stubs in a cluster

    Hello all,
    I'm trying to find out for a week now if members of a cluster can get out of synch
    regarding "Object Hash Code" of RMI stubs in the JNDI.
    After binding an RMI object to one server (no rmic performed since the object
    is in the classpath of both servers and the service is pinned), the JNDI mapping
    looked identical on both servers.
    However, while one server went down for a few hours, the other server has changed
    the "Object Hash Code" to a new one (the binding name stayed constant). When the
    server went up again it tried to lookup the object under the same binding, then
    found it but failed to execute remote methods on it. An error message says that
    the object was garbage collected:
    java.rmi.NoSuchObjectException: Unable to dispatch request to Remote object with
    id: '347'. The object has been garbage collected. at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:766)
    at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:738) at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerServer.java:207)
    at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:777) at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:508)
    at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:664) at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    Why isn't the new JNDI mapping replicated to the new booting server? Should I
    use specific rmic flags? How can I maintain the JNDI trees identical on all clustered
    servers?
    I'm using two managed WLS 7.02 servers running on win2000 servers.
    Dani

    Hi Andy,
    Thank you for responding.
    The binding code looks like that:
    m_ctx = new InitialContext();
    int index = getNextAvailableRepositoryJNDIIndex();
    m_ctx.bind(
    NODE_PREFIX+index,
    this
    where this is the Remote implementation.
    How will I make the object hash code constant or have all views remain constant
    when the GC changes its reference?
    Dani
    Andy Piper <[email protected]> wrote:
    "Daniel Gordon" <[email protected]> writes:
    I'm trying to find out for a week now if members of a cluster can getout of synch
    regarding "Object Hash Code" of RMI stubs in the JNDI.The hash code can probably change since the stub represents an
    aggregate view of the cluster. But this may be a red-herring. What
    does your code look like that binds the rmi object? It may be that DGC
    is biting you.
    andy

  • Mathscript and object oriented code m code

    Hello,
    I have some existing code written in Matlab with object-oriented programming that I would like to use with Mathscript RT nodes in LabVIEW.
    Does NI have any plan to support object-oriented programming in mathscript RT nodes in the future?
    In the mean time, is there any easy solution with minimum changes that would allow me to use my existing code?
    Thanks

    Hey L54,
    Unfortunately, there have not been any public announcements regarding the support of object-oriented code for the MathScript RT nodes. Also, for tips on how to change your code to make it work, there really is no easy way to go about doing this.
    Are you deploying to a RT target? Would it be possible for you to use the MATLAB Script Node? This is included with LabVIEW and actually connects to your MATLAB software and would most likely be able to run the object-oriented code.
    Sorry about not supporting object-oriented code, but hopefully using the MATLAB Script Node help you achieve your desired functionality.
    Joe S
    Applications Engineer
    National Instruments
    MATLAB is a registered trademark of The MathWorks, Inc.

  • Example code for java compiler with a simple GUI

    There is no question here (though discussion of the code is welcome).
    /* Update 1 */
    Now available as a stand alone or webstart app.! The STBC (see the web page*) has its own web page and has been improved to allow the user to browse to a tools.jar if one is not found on the runtime classpath, or in the JRE running the code.
    * See [http://pscode.org/stbc/].
    /* End: Update 1 */
    This simple example of using the JavaCompiler made available in Java 1.6 might be of use to check that your SSCCE is actually what it claims to be!
    If an SSCCE claims to display a runtime problem, it should compile cleanly when pasted into the text area above the Compile button. For a compilation problem, the code should show the same output errors seen in your own editor (at least until the last line of the output in the text area).
    import java.awt.BorderLayout;
    import java.awt.Font;
    import java.awt.EventQueue;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JLabel;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JButton;
    import javax.swing.SwingWorker;
    import javax.swing.border.EmptyBorder;
    import java.util.ArrayList;
    import java.net.URI;
    import java.io.ByteArrayOutputStream;
    import java.io.OutputStreamWriter;
    import javax.tools.ToolProvider;
    import javax.tools.JavaCompiler;
    import javax.tools.SimpleJavaFileObject;
    /** A simple Java compiler with a GUI.  Java 1.6+.
    @author Andrew Thompson
    @version 2008-06-13
    public class GuiCompiler extends JPanel {
      /** Instance of the compiler used for all compilations. */
      JavaCompiler compiler;
      /** The name of the public class.  For 'HelloWorld.java',
      this would be 'HelloWorld'. */
      JTextField name;
      /** The source code to be compiled. */
      JTextArea sourceCode;
      /** Errors and messages from the compiler. */
      JTextArea output;
      JButton compile;
      static int pad = 5;
      GuiCompiler() {
        super( new BorderLayout(pad,pad) );
        setBorder( new EmptyBorder(7,4,7,4) );
      /** A worker to perform each compilation. Disables
      the GUI input elements during the work. */
      class SourceCompilation extends SwingWorker<String, Object> {
        @Override
        public String doInBackground() {
          return compileCode();
        @Override
        protected void done() {
          try {
            enableComponents(true);
          } catch (Exception ignore) {
      /** Construct the GUI. */
      public void initGui() {
        JPanel input = new JPanel( new BorderLayout(pad,pad) );
        Font outputFont = new Font("Monospaced",Font.PLAIN,12);
        sourceCode = new JTextArea("Paste code here..", 15, 60);
        sourceCode.setFont( outputFont );
        input.add( new JScrollPane( sourceCode ),
          BorderLayout.CENTER );
        sourceCode.select(0,sourceCode.getText().length());
        JPanel namePanel = new JPanel(new BorderLayout(pad,pad));
        name = new JTextField(15);
        name.setToolTipText("Name of the public class");
        namePanel.add( name, BorderLayout.CENTER );
        namePanel.add( new JLabel("Class name"), BorderLayout.WEST );
        input.add( namePanel, BorderLayout.NORTH );
        compile = new JButton( "Compile" );
        compile.addActionListener( new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
              (new SourceCompilation()).execute();
        input.add( compile, BorderLayout.SOUTH );
        this.add( input, BorderLayout.CENTER );
        output = new JTextArea("", 5, 40);
        output.setFont( outputFont );
        output.setEditable(false);
        this.add( new JScrollPane( output ), BorderLayout.SOUTH );
      /** Compile the code in the source input area. */
      public String compileCode() {
        output.setText( "Compiling.." );
        enableComponents(false);
        String compResult = null;
        if (compiler==null) {
          compiler = ToolProvider.getSystemJavaCompiler();
        if ( compiler!=null ) {
          String code = sourceCode.getText();
          String sourceName = name.getText().trim();
          if ( sourceName.toLowerCase().endsWith(".java") ) {
            sourceName = sourceName.substring(
              0,sourceName.length()-5 );
          JavaSourceFromString javaString = new JavaSourceFromString(
            sourceName,
            code);
          ArrayList<JavaSourceFromString> al =
            new ArrayList<JavaSourceFromString>();
          al.add( javaString );
          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          OutputStreamWriter osw = new OutputStreamWriter( baos );
          JavaCompiler.CompilationTask task = compiler.getTask(
            osw,
            null,
            null,
            null,
            null,
            al);
          boolean success = task.call();
          output.setText( baos.toString().replaceAll("\t", "  ") );
          compResult = "Compiled without errors: " + success;
          output.append( compResult );
          output.setCaretPosition(0);
        } else {
          output.setText( "No compilation possible - sorry!" );
          JOptionPane.showMessageDialog(this,
            "No compiler is available to this runtime!",
            "Compiler not found",
            JOptionPane.ERROR_MESSAGE
          System.exit(-1);
        return compResult;
      /** Set the main GUI input components enabled
      according to the enable flag. */
      public void enableComponents(boolean enable) {
        compile.setEnabled(enable);
        name.setEnabled(enable);
        sourceCode.setEnabled(enable);
      public static void main(String[] args) throws Exception {
        Runnable r = new Runnable() {
          public void run() {
            JFrame f = new JFrame("SSCCE text based compiler");
            f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            GuiCompiler compilerPane = new GuiCompiler();
            compilerPane.initGui();
            f.getContentPane().add(compilerPane);
            f.pack();
            f.setMinimumSize( f.getSize() );
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        EventQueue.invokeLater(r);
    * A file object used to represent source coming from a string.
    * This example is from the JavaDocs for JavaCompiler.
    class JavaSourceFromString extends SimpleJavaFileObject {
      * The source code of this "file".
      final String code;
      * Constructs a new JavaSourceFromString.
      * @param name the name of the compilation unit represented
        by this file object
      * @param code the source code for the compilation unit
        represented by this file object
      JavaSourceFromString(String name, String code) {
        super(URI.create(
          "string:///" +
          name.replace('.','/') +
          Kind.SOURCE.extension),
          Kind.SOURCE);
        this.code = code;
      @Override
      public CharSequence getCharContent(boolean ignoreEncodingErrors) {
        return code;
    }Edit 1:
    Added..
            f.setMinimumSize( f.getSize() );Edited by: AndrewThompson64 on Jun 13, 2008 12:24 PM
    Edited by: AndrewThompson64 on Jun 23, 2008 5:54 AM

    kevjava wrote: Some things that I think would be useful:
    Suggestions reordered to suit my reply..
    kevjava wrote: 2. Line numbering, and/or a line counter so you can see how much scrolling you're going to be imposing on the forum readers.
    Good idea, and since the line count is only a handful of lines of code to implement, I took that option. See the [line count|http://pscode.org/stbc/help.html#linecount] section of the (new) [STBC Help|http://pscode.org/stbc/help.html] page for more details. (Insert plaintiff whining about the arbitrary limits set - here).
    I considered adding line length checking, but the [Text Width Checker|http://pscode.org/twc/] ('sold separately') already has that covered, and I would prefer to keep this tool more specific to compilation, which leads me to..
    kevjava wrote: 1. A button to run the code, to see that it demonstrates the problem that you wish for the forum to solve...
    Interesting idea, but I think that is better suited to a more full blown (but still relatively simple) GUId compiler. I am not fully decided that running a class is unsuited to STBC, but I am more likely to implement a clickable list of compilation errors, than a 'run' button.
    On the other hand I am thinking the clickable error list is also better suited to an altogether more abled compiler, so don't hold your breath to see either in the STBC.
    You might note I have not bothered to update the screenshots to show the line count label. That is because I am still considering error lists and running code, and open to further suggestion (not because I am just slack!). If the screenshots update to include the line count but nothing else, take that as a sign. ;-)
    Thanks for your ideas. The line count alone is worth a few Dukes.

  • CcmSetup failed with error code 0x8004100e - CcmGetOSVersion failed with 0x8004100e

    Hi ,
    the installation failed for clients with the following errors
    CcmSetup failed with error code 0x8004100e
    CcmGetOSVersion failed with 0x8004100e
    SCCM Verion 2012 R2  (Upgraded from 2012)
    Client O.S 2008 R2 SP1
    Ramy

    Hi Jason,
    please check this logs
    ==========[ ccmsetup started in process 9516 ]==========    ccmsetup    8/14/2014 4:29:51 PM    10476 (0x28EC)
    Running on platform X64    ccmsetup    8/14/2014 4:29:51 PM    10476 (0x28EC)
    Updated security on object C:\Windows\ccmsetup\cache\.    ccmsetup    8/14/2014 4:29:51 PM    10476 (0x28EC)
    Launch from folder C:\Windows\ccmsetup\    ccmsetup    8/14/2014 4:29:51 PM    10476 (0x28EC)
    CcmSetup version: 5.0.7958.1000    ccmsetup    8/14/2014 4:29:51 PM    10476 (0x28EC)
    In ServiceMain    ccmsetup    8/14/2014 4:29:51 PM    9472 (0x2500)
    Successfully started the ccmsetup service    ccmsetup    8/14/2014 4:29:51 PM    8180 (0x1FF4)
    Deleted file C:\Windows\ccmsetup\ccmsetup.exe.download    ccmsetup    8/14/2014 4:29:51 PM    8180 (0x1FF4)
    Folder 'Microsoft\Configuration Manager' not found. Task does not exist.    ccmsetup    8/14/2014 4:29:51 PM    8180 (0x1FF4)
    CcmSetup is exiting with return code 0    ccmsetup    8/14/2014 4:29:51 PM    8180 (0x1FF4)
    All other instances of ccmsetup have completed.    ccmsetup    8/14/2014 4:29:51 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:52 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:53 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:54 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:55 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:56 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:57 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:58 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:29:59 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:30:01 PM    5732 (0x1664)
    Attempt to delete ccmsetup.exe failed (5)    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    Failed to delete C:\Windows\ccmsetup\ccmsetup.exe (5). Renaming and queuing for deletion on reboot.    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    Successfully renamed C:\Windows\ccmsetup\ccmsetup.exe to C:\Windows\ccmsetup\DELEB07.tmp and queued for deletion on reboot.    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    Downloading file C:\Setup\Client\ccmsetup.exe    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    Downloading C:\Setup\Client\ccmsetup.exe to C:\Windows\ccmsetup\ccmsetup.exe    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    File download 16% complete (262144 of 1614520 bytes).    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    File download 32% complete (524288 of 1614520 bytes).    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    File download 48% complete (786432 of 1614520 bytes).    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    File download 64% complete (1048576 of 1614520 bytes).    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    File download 81% complete (1310720 of 1614520 bytes).    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    File download 97% complete (1572864 of 1614520 bytes).    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    File download 100% complete (1614520 of 1614520 bytes).    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    Download complete.    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    Failed to create the ccmsetup service 0x(80070431)    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    A Fallback Status Point has not been specified.  Message with STATEID='301' will not be sent.    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    CcmSetup failed with error code 0x80070431    ccmsetup    8/14/2014 4:30:02 PM    5732 (0x1664)
    CheckAndLogOSInformation failed with 0x8004100e    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    Ccmsetup command line: "C:\Windows\ccmsetup\ccmsetup.exe" /runservice /source:"C:\Setup\Client" "SMSSLP=ldcsccm1v.linkdc.local" "SMSSITECODE=ldc" "DNSSUFFIX=linkdc.local"    ccmsetup  
     8/14/2014 4:40:16 PM    9472 (0x2500)
    Command line parameters for ccmsetup have been specified.  No registry lookup for command line parameters is required.    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    Command line: "C:\Windows\ccmsetup\ccmsetup.exe" /runservice /source:"C:\Setup\Client" "SMSSLP=ldcsccm1v.linkdc.local" "SMSSITECODE=ldc" "DNSSUFFIX=linkdc.local"    ccmsetup    8/14/2014
    4:40:16 PM    9472 (0x2500)
    SslState value: 224    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    CCMHTTPPORT:    80    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    CCMHTTPSPORT:    443    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    CCMHTTPSSTATE:    224    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    CCMHTTPSCERTNAME:        ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    SMSSLP:    ldcsccm1v.linkdc.local    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    FSP:        ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    CCMFIRSTCERT:    1    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    Config file:          ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    Retry time:       10 minute(s)    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    MSI log file:     C:\Windows\ccmsetup\Logs\client.msi.log    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    MSI properties:    SMSSLP="ldcsccm1v.linkdc.local" SMSSITECODE="ldc" DNSSUFFIX="linkdc.local" CCMHTTPPORT="80" CCMHTTPSPORT="443" CCMHTTPSSTATE="224" CCMFIRSTCERT="1"  
     ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    Source List:    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
                      C:\Setup\Client    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    MPs:    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
                      None    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    No version of the client is currently detected.    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    Folder 'Microsoft\Configuration Manager' not found. Task does not exist.    ccmsetup    8/14/2014 4:40:16 PM    9472 (0x2500)
    Updated security on object C:\Windows\ccmsetup\.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    A Fallback Status Point has not been specified.  Message with STATEID='100' will not be sent.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Running as user "SYSTEM"    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Detected 28163 MB free disk space on system drive.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Checking Write Filter Status.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    This is not a supported write filter device. We are not in a write filter maintenance mode.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Performing AD query: '(&(ObjectCategory=mSSMSManagementPoint)(mSSMSDefaultMP=TRUE)(mSSMSSiteCode=ldc))'    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    OperationalXml '<ClientOperationalSettings><Version>5.00.7958.1000</Version><SecurityConfiguration><SecurityModeMask>0</SecurityModeMask><SecurityModeMaskEx>480</SecurityModeMaskEx><HTTPPort>80</HTTPPort><HTTPSPort>443</HTTPSPort><CertificateStoreName></CertificateStoreName><CertificateIssuers></CertificateIssuers><CertificateSelectionCriteria></CertificateSelectionCriteria><CertificateSelectFirstFlag>1</CertificateSelectFirstFlag><SiteSigningCert>308202F3308201DBA00302010202107B6F93150C5A958F411F813122BF4CEA300D06092A864886F70D01010B05003016311430120603550403130B53697465205365727665723020170D3133303832363136353035335A180F32313133303830333136353035335A3016311430120603550403130B536974652053657276657230820122300D06092A864886F70D01010105000382010F003082010A0282010100A8BD6E83FE1AE591E87E59E17F6E3119068166C37F0F02911246B003878146DD4EF98F26A8E37DAB3D557545913127A780CDD9D8DB46E7A1BD52B28BB8FD42E21339065C8A24EA06EEAEFB0177DAFE0E62DB30ECCA68DB1B6EA3BC985D2D26DDBF180938BBEA36F56E5604FED265E2E01154AC495C5269D577C10B523C6B3CDCBFEE44961D08ED5E298381F927C49494E35FA5634B1C56847A55EFB52B0E32BFACE704E0A2F44A39D9D656B9097BF93AF2466242CC2CB050B02734E46A0EC3553249599BD5CC5917CC408938FAFF8FF097B434FDD9F9174AF6C533FE220E93929DF082FCE7A11143AB7B5D2537829D18B6F756B85A68B0B7C520728165BF4EAB0203010001A33B303930210603551D11041A301882164C44435343434D31562E4C696E6B44432E4C6F63616C30140603551D25040D300B06092B060104018237650B300D06092A864886F70D01010B05000382010100477430C70E8B5E48E78912C71B22C86DCE5ED91A429A786346B1EE5C076697C080056C52B1649FA4366D7AEAC08B35AC01734365D2A38B7A797DF1420027BFA103DEF91109F0025A20DA6C592807F134C7283219A88D6B5592A1993134A2649D6F6F663BCE0D872675D260D9D61C59EE1D36A602110839D5CC6F15C7FF842C92A118A0BCECD302F36235FFB79EF37054FB998D3666337B3C5DBBF6C1553600044CD4940FBDDE18EAE3A2B94E31FEC72DA32A7B8BC86A8868B92F782547B799E898A3B1460576A70773F58FE9D2D3363BF04796A91E66155E419B9E50946287A213C4E8A3BB81BA1FEEB9E9EDF86EA4627F7E421281532B0B340834F2A92C3215</SiteSigningCert></SecurityConfiguration><RootSiteCode>LDC</RootSiteCode><CCM>
    <CommandLine>SMSSITECODE=LDC</CommandLine> </CCM><FSP> <FSPServer></FSPServer> </FSP><Capabilities SchemaVersion ="1.0"><Property Name="SSLState" Value="0" /></Capabilities><Domain
    Value="LinkDC.Local" /><Forest Value="LinkDC.Local" /></ClientOperationalSettings>'    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Unable to open Registry key Software\Microsoft\CCM. Return Code [80070002]. Client HTTPS state is Unknown.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    The MP name retrieved is 'LDCSCCM1V.LinkDC.Local' with version '7958' and capabilities '<Capabilities SchemaVersion="1.0"><Property Name="SSLState" Value="0"/></Capabilities>'    ccmsetup  
     8/14/2014 4:40:17 PM    9472 (0x2500)
    MP 'LDCSCCM1V.LinkDC.Local' is compatible    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Retrieved 1 MP records from AD for site 'ldc'    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Retrived site version '5.00.7958.1000' from AD for site 'ldc'    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    SiteCode:         ldc    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    SiteVersion:      5.00.7958.1000    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Ccmsetup is being restarted due to an administrative action. Installation files will be reset and downloaded again.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Deleted file C:\Windows\ccmsetup\client.msi    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Deleted file C:\Windows\ccmsetup\client.msi.download    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    No MPs were specified from commandline or the mobileclient.tcf.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Downloading file ccmsetup.cab    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Determining source location...    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Found accessible source: C:\Setup\Client    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Found available source C:\Setup\Client\    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Downloading C:\Setup\Client\ccmsetup.cab to C:\Windows\ccmsetup\ccmsetup.cab    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    File download 100% complete (9662 of 9662 bytes).    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Deleted file C:\Windows\ccmsetup\ccmsetup.cab    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Download complete.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    C:\Windows\ccmsetup\ccmsetup.cab is Microsoft trusted.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Successfully extracted manifest file C:\Windows\ccmsetup\ccmsetup.xml from file C:\Windows\ccmsetup\ccmsetup.cab.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Loading manifest file: C:\Windows\ccmsetup\ccmsetup.xml    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Successfully loaded ccmsetup manifest file.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Checking if manifest version '5.00.7958.1000' is newer than the ccmsetup version '5.0.7958.1000'    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    Running from temp downloaded folder or manifest is not newer than ccmsetup.    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    CcmGetOSVersion failed with 0x8004100e    ccmsetup    8/14/2014 4:40:17 PM    9472 (0x2500)
    A Fallback Status Point has not been specified.  Message with STATEID='301' will not be sent.    ccmsetup    8/14/2014 4:40:17 PM    10476 (0x28EC)
    'Configuration Manager Client Retry Task' is scheduled to run at 08/14/2014 09:40:17 PM (local) 08/14/2014 06:40:17 PM (UTC) time with arguments ' /source:"C:\Setup\Client" "SMSSLP=ldcsccm1v.linkdc.local" "SMSSITECODE=ldc" "DNSSUFFIX=linkdc.local"
    /RetryWinTask:1'.    ccmsetup    8/14/2014 4:40:17 PM    10476 (0x28EC)
    Creating Windows Task Scheduler folder 'Microsoft\Configuration Manager'...    ccmsetup    8/14/2014 4:40:17 PM    10476 (0x28EC)
    CcmSetup failed with error code 0x8004100e    ccmsetup    8/14/2014 4:40:17 PM    10476 (0x28EC)
    Ramy

Maybe you are looking for