opencv running tutorial test undeclared indentifier - visual-studio-2010

I have been trying to install opencv from source for a while now on i have been using the tutorials from
http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html
I got as far a attempting to build the opencv test project in visual studio (i have built it in x86 but i have windows 7 (x64) dont really think it is related to the problem but just in case someone asks).
Now i build the project and I get the following errors:
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(64): error C2065: 'CV_CAP_PROP_FRAME_WIDTH' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(65): error C2065: 'CV_CAP_PROP_FRAME_HEIGHT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(66): error C2065: 'CV_CAP_PROP_FRAME_WIDTH' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(67): error C2065: 'CV_CAP_PROP_FRAME_HEIGHT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(79): error C2065: 'CV_WINDOW_AUTOSIZE' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(80): error C2065: 'CV_WINDOW_AUTOSIZE' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(81): error C3861: 'cvMoveWindow': identifier not found
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(82): error C3861: 'cvMoveWindow': identifier not found
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(85): error C2065: 'CV_CAP_PROP_FRAME_COUNT' : undeclared identifier
1>l:\documents\researchproject\opencv_workspace\projects\example1\example1\test.cpp(129): error C3861: 'cvWaitKey': identifier not found
However when i can follow the declaration of highgui.hpp in visual to the file that contains CV_CAP_PROP_FRAME_WIDTH (which for some reason is opencv2/highgui.hpp not opencv2/highgui/highgui.hpp but the latter references the first).
Can anyone explain to why visual studio is not finding the these identifiers?
I have read the link several times and i think i have done everything in there, i would appreciate any help as this is cracking me up.
EDIT AND SOLVED:
Right feel a bit dumb right now, but i will leave this here to others that might find this issue when compiling from github opencv and following the tutorials, the previous issue occurs because changes have occurred in from the version in the website and the one in github, please use the source code version in github (at the time of writing 2.4.9)
https://github.com/Itseez/opencv/blob/master/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/Test.cpp
In this version the CV and cv prefix from enums and methods has disappeared.
I hope this helps and sorry for putting the question and replying to it after, but i did spent a while looking at it.

Related

Visual Studio error when ITK and VTK is used

I am doing a project in visual studio 2015When i included ITK and compiled everything ,some errors are occurring
Error C3861 '_beginthreadex': identifier not found
Error C2039 '_time64': is not a member of '`global namespace''
Error C3861 '_time64': identifier not found
Error C3861 '_mktime64': identifier not found
Error C3861 '_mktime64': identifier not found
Error C3861 '_gmtime64_s': identifier not found
Error C3861 '_localtime64_s': identifier not found
Error C3861 '_mktime64': identifier not found
Error C3861 '_localtime64_s': identifier not found
Error C3861 '_gmtime64_s': identifier not found
Error C2039 '_time64': is not a member of '`global namespace''
Error C3861 '_time64': identifier not found
Error C3646 'm_nLastAnimTime': unknown override specifier
Error C4430 missing type specifier - int assumed. Note: C++ does not
support default-int
Error C3646 'm_ActiveTime': unknown override specifier
Error C4430 missing type specifier - int assumed. Note: C++ does not
support default-int
Error C3646 'm_clkLastTime': unknown override specifier
But i tried including Visual studio/VC/Include and Visual Studio/VC/bin to the Additional Include Directories,still it is showing the same errors.
I also tried changing the Use of MFC and c++ ->code generation ->Runtime Library in configuration properties as well.
I referred this link also,but my problem is not solved.
So i thought may be because of vs2015 instalation problems and tried to build a new project using VTK and ITK in Visualstudio 2017,In there also the same errors are occurring.I have been stuck for weeks ,Can anyone give a solution for my problem?
Are you using this procedure to build ITK and VTK? Are you following this guide to build your own application? Using CMake is the only supported way of using ITK and/or VTK.
If you cannot use CMake, a workaround is to build a hello world example using CMake and then copy include paths and list of libraries to your main Visual Studio application.

What settings prevent AllocConsole from being included?

I've created a new windows universal dll project in VS2015. I'm trying to use AllocConsole() to create a console window, but I'm getting the errors
error C3861: 'FreeConsole': identifier not found
error C3861: 'AllocConsole': identifier not found
error C2065: 'FILE': undeclared identifier
error C2065: 'stream': undeclared identifier
error C2065: 'stream': undeclared identifier
error C2065: 'stdout': undeclared identifier
error C3861: 'freopen_s': identifier not found
This is after including windows.h, and wincon.h, and consoleapi.h (not sure what this is, F12 took me to it)
I'm guessing it's a project setting that's preventing this from working?

Issues compiling rosbag_storage on OSX

Compiling Ros (Jade) on OSX using this tutorial, I get the following error for rosbag_storage while running ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release:
ros/ros_catkin_ws/src/ros_comm/rosbag_storage/src/buffer.cpp:71:5: error: use of undeclared identifier 'assert'
assert(buffer_);
And then a bunch of errors of the kind:
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:916:9: error: use of undeclared identifier 'assert'
BOOST_ASSERT( deleter_.use_count() <= 1 );
Where could that come from?
Looks like it was coming from a conflict with GStreamer, like in this issue. Just removing /Library/Frameworks/GStreamer.framework/Headers/assert.h was enough to solve the problem:
mv /Library/Frameworks/GStreamer.framework/Headers/assert.h /Library/Frameworks/GStreamer.framework/Headers/assert.h.bak

Build boost asio 1.58 for windows phone 8.1 & windows 8.1

I had try to build Boost Asio 1.58 for Windows Phone 8.1 & Windows 8.1 with that command b2
b2 toolset=msvc=12.0 windows-api=store architecture=arm
but it's fail on build "libboost_regex-vc120-mt-1_58.lib", so i must need "libboost_regex-vc120-mt-1_58.lib" .
The log say error!
libs\regex\build..\src\fileiter.cpp(102) : error C3861: 'CreateFileA': identifier not found
libs\regex\build..\src\fileiter.cpp(106) : error C3861: 'CreateFileMapping': identifier not found
libs\regex\build..\src\fileiter.cpp(115) : error C3861: 'MapViewOfFile': identifier not found
libs\regex\build..\src\fileiter.cpp(124) : error C3861: 'GetFileSize': identifier not found
libs\regex\build..\src\fileiter.cpp(141) : error C3861: 'UnmapViewOfFile': identifier not found
libs\regex\build..\src\fileiter.cpp(383) : error C3861: 'FindFirstFileA': identifier not found
So anyone can help me fix it ? Thanks :)
Go to C++ -> Preprocessor -> Add "BOOST_REGEX_NO_LIB" for disable auto linking Boost.Regex

Compiling Z3 for OCaml

I tried to compile the OCaml version for Z3, however when I build it, it always shows a bunch of error and warning.
These are several of the errors:
z3_stubs.c:7384: error: storage size of `_ctxs' isn't known
z3_stubs.c:7385: error: `camlidl_ctx' undeclared (first use in this function)
z3_stubs.c:7385: error: expected `;' before `_ctx'
I dont really get it, I just try to run the build.cmd, and the error happens, anyone has an idea?
Do you have camlidl installed?

Resources