run error xmemory() with function findchessboardcorners()? - c++

I am using OpenCV and MS Visual Studio 2013 to simply detect chessboard. It compiles and build all fine but gives a runtime error in xmemory0() file located in:
c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0
I just cant seem to understand the problem. Any thought would be appreciated.
The debugger breaks in xmemory0(), I thought that the problem in findChessboardCorners() function and library opencv-core2410. I tried same function with vs2010 and it works, but I need to do it with vs2013.

After hard work i found that i must determine the size of cv::vector variables before use it, for example:
cv::vector<Point2f> corners;
corners.resize(54);
bool patternfound = findChessboardCorners(gray, patternsize, corners,CV_CALIB_CB_ADAPTIVE_THRESH | CV_CALIB_CB_FAST_CHECK | CV_CALIB_CB_NORMALIZE_IMAGE);
I didn't need to resize vector in vs2010 but just in vs2013.

Related

Is there any way to force visual studio to show me location of an error in *my* code, instead of pointing to the standard library?

I have a small piece of code that does not compile
Visual Studio shows me this error and points to xhash:
Error C2064 term does not evaluate to a function taking 1 arguments C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\xhash 114
I know that error is somewhere in my code, probably related to unordered map, so template does not resolve. I'm wondering if there's a way to see which part of my code causes compilation error
The full build output will have many more lines, in the form ".. Instantiated from here...". Typically the last of these lines will point to your faulty code, possibly more if you wrote a template yourself.

Visual studio 2015 . How to *not* step in certain functions?

I'd like to configure the VS2015 debugger so that when I'm stepping in into some code (F11), it steps through certain functions .
For example, let's say there is a template class SmartPointer which has an overloaded member -> .
If I have the following statement :
SmartPointer<SomeClass> ptr;
/* initialize ptr */
ptr->method();
The debugger will step into SmartPointer::operator->, exit, then the into method().
I'd like to directly step into method().
Is this possible ?
EDIT : The so called duplicate isn't one because it doesn't work with vs2013 or 2015
Ok I actually found the solution. You have to edit as an administrator:
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\Packages\Debugger\Visualizers\default.natstepfilter
or
C:\Program Files\Microsoft Visual Studio
14.0\Common7\Packages\Debugger\Visualizers\default.natstepfilter
depending if you're under a 64 or 32 bit machine. The add a line like
<Function><Name>SomeFunction</Name><Action>NoStepInto</Action></Function>
HTH

"Undeclared identifier" error if trying to include libvlc under Windows in C++

I Include the file "libvlc.h" from the VLC main git repository (https://github.com/videolan/vlc.git) in my Visual Studio project, I get various error e.g.
The identifier "libvlc_int_t"" is not declared. Video [...]\vlc\src\libvlc.h 34
What am I doing wrong?
This is my (german) VS output:
http://pastebin.com/MkAeJzgv
I had the same in Visual Studio 2010 Update 1. However, it was easily fixed
replacing all the occurrences of "ssize_t" by "intptr_t".
Original comment by felipe.a...#gmail.com on 8 Feb 2013 at 1:22
It works.
define ssize_t to SSIZE_T in predefined headers (ex:"stdafx.h") in Visual studio .

Compiler reference error due to calling ulldiv.asm for c++ program

This is a strange error. When I run my code, I had to update the location of ulldiv.asm via
implementation of unsigned long long division
the line in question matched exactly the one used in the link:http://objectmix.com/c/68732-dynamic-memory-allocation-c.html
tim = (__time64_t)((nt_time.ft_scalar - EPOCH_BIAS) / 10000000i64);
Anyways, the first link gave me the right answer and I relocated ulldiv.asm to C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\crt\src\intel\ulldiv.asm.
Now when I run my code this line gives me trouble
double NOISE_SIGMA = NOISE_DENSITY*sqrt(SYS_CLK_FREQ);
the sqrt function becomes undefined (?). The debugger stops and asks me for the location of sqrt.asm.
You need to find sqrt.asm to view the source for the current call stack frame
This is a similar error that I found in a German website: http://www.c-plusplus.de/forum/324725-full
but it doesn't seem to get resolved there.
I don't understand what's going on. If you need more information regarding the code, let me know. Thank you in advance.
If it makes any difference I step through my code using F11.
While most of the source files for the Visual C++ libraries are included with the Visual Studio installation, some files are not included. Notably, the sources for the math library are not included.
The fact that the debugger cannot automatically find ulldiv.asm is a bug; this has been fixed in Visual Studio "14" (I think the fix was present in CTP1; I know for sure the fix is present in CTP3 which was released today).

Can not find mpirxx.h after building the mpir-2.6.0 library in vc++

I need to use mpir-2.6.0 library with visual c++ 2010. My code is going to be in c++.
I extracted both folders (mpir-2.6.0 and vsyasm-1.2.0-win32). Then, I copied the content of the folder vsyasm-1.2.0-win32 (including vsyasm.exe after renaming it to yasm.exe and placing it in: C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\. Then, I opened the project: mpir.sln which is placed in: \mpir-2.6.0\build.vc10. Then, I changed the Project configuration to: Release.
When I try to build the whole solution, I get a lot of errors such as:
error C1020: unexpected #endif c:\proj\mpir-2.6.0\mpir-2.6.0\mpir.h 4 1 lib_mpir_gc
error C1020: unexpected #endif c:\proj\mpir-2.6.0\mpir-2.6.0\mpir.h 4 1 lib_mpir_gc
error C1020: unexpected #endif c:\proj\mpir-2.6.0\mpir-2.6.0\mpir.h 4 1 lib_mpir_gc
But when I build every library separately, it is successful.
After the build, I went to: \mpir-2.6.0\build.vc10\Win32\Release
and find the files:
mpir.lib
mpirxx.lib
mpir.pdb
mpirxx.pdb
But I can not find the files:
mpir.h
mpirxx.h
Which I need to copy them the visual studio include file.
My main source for these configuration is: http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/ (but this was for old versions for the library and the ysam). I do not understand the reasons for these errors. I was able to configure the library with old version. But I need to upgrade as there are improvements in the library and mine is very old one.
The output files are now located in mpir\lib\Win32\Release or mpir\dll\Win32\Release.
The recommended way to build MPIR specifcally for your CPU is to first run mpir_config.py which is located in the build.vc10 directory. mpir_config.py will prompt you with a list of CPU options. Then when you open mpir.sln, you should only compile code for the specific CPU. And then you compile the C++ wrapper (i.e. compile lib_mpir_p3 first, and then lib_mpir_cxx).
Edit: I just noticed another error from your original post. You need to rename the directory "mpir-2.6.0" to "mpir". The directory layout needs to be "<>\mpir\build.vc10"
I had the same problem with MPIR 2.6.0 and VS 2012. What I did to make MPIR work was to build lib_gc and lib_cxx, both with win32 and release mode. Because my c++ application is win32 console, this way it worked perfectly.
Becuase my windows is 64, I thought I had to build 64 versions, but turned out that I was wrong.