A
A
Asya2016-05-23 22:45:42
C++ / C#
Asya, 2016-05-23 22:45:42

Why can't I use OpenCV in Visual Studio 2012?

I downloaded OpenCV 2.4.12 and now I'm trying to run this code in visual studio:

#include <stdio.h>
#include <cv.h>
#include <highgui.h>

int main(int argc, char* argv[])
{
if (argc < 2)
{
    printf("Usage: ./opencv_hello <file.png>\n");
    return -1;
}

    IplImage* img = cvLoadImage(argv[1], CV_LOAD_IMAGE_UNCHANGED);
if (!img)
{
    return -1;
}

cvNamedWindow("display", CV_WINDOW_AUTOSIZE);
    cvShowImage("display", img );

    cvWaitKey(0);        
    return 0;
}

It compiles without errors:
36acf99ae2044c269e526cb39a864fad.pngBut when I try to run it, this appears:
a1f27e3e7c7f49c88cfb6739a11ec77f.png
"nevermind.exe" (Win32). Загружено "C:\blablabla\nevermind\Debug\nevermind.exe". Символы загружены.
"nevermind.exe" (Win32). Загружено "C:\Windows\SysWOW64\ntdll.dll". Невозможно найти или открыть файл PDB.
"nevermind.exe" (Win32). Загружено "C:\Windows\SysWOW64\kernel32.dll". Невозможно найти или открыть файл PDB.
"nevermind.exe" (Win32). Загружено "C:\Windows\SysWOW64\KernelBase.dll". Невозможно найти или открыть файл PDB.
"nevermind.exe" (Win32). Загружено "C:\Windows\SysWOW64\msvcp110d.dll". Символы загружены.
"nevermind.exe" (Win32). Загружено "C:\Windows\SysWOW64\msvcr110d.dll". Символы загружены.
Поток 0x1cb4 завершился с кодом -1073741701 (0xc000007b).
Поток 0x2ca4 завершился с кодом -1073741701 (0xc000007b).
Поток 0x2850 завершился с кодом -1073741701 (0xc000007b).
Программа "[8280] nevermind.exe" завершилась с кодом -1073741701 (0xc000007b).

I understand that this is somehow connected with troubles between x32 and x64, but I don’t know how to fix it :(
Help!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
maaGames, 2016-05-24
@maaGames

dll files from opencv put next to exe?
Run it under a debugger and see where exactly it crashes.

D
Dmitry Korolev, 2015-08-14
@Enniack

adapt

There is a simple word "adapt". Don't force the tongue.
1) Correctly make up so that later others can understand what you made up for there. I see no reason not to use absolute positioning in this case.
2) only then
4) If you mean class placement under "using the bootstrap grid", then probably yes and no. Because adaptation is not only a grid. These are solid nuances in the arrangement of blocks and elements, in their sizes, in typography, and so on.
5) If he wants to have a mobile version, he must definitely. Otherwise, as they say, claims are not accepted.
This is fundamentally the wrong approach. If it suddenly happened that you a) do not build according to the principle of mobile-first, b) do not have the design of mobile versions available, c) have to do everything on your own, then the approach, in my opinion, should be as follows: gradually reduce screen (not forgetting about the height too), something went wrong or started to look bad - we introduce the appropriate styles for this particular resolution. And so on to the bare minimum.
I do not answer the third question, because the topic is very extensive. The nuances of layout in one article and even a book, in principle, cannot be covered. Well, except that it will be a very large book. It's a pity that this would be outdated immediately after the release. And the rules of good code are scattered all over the network. Well , for example.

P
Pavel, 2015-08-13
@mrusklon

4) bootstrap grid, it's like a part of the media, so you just finish the existing styles.
5) sometimes they make a layout for a mobile device, but this is rare. You have to cut it yourself, and then redo it a couple more times until the person likes it :(

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question