I am learning openCV.after I set my Visual Studio,the code can not be Compiled

asked 2018-07-20 04:50:06 -0500

sasalicat gravatar image

updated 2018-07-21 23:52:27 -0500

codes are showing below:

// ConsoleApplication2.cpp: 定义控制台应用程序的入口点。
//
#include <opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include <cstdio>
#include <opencv2/opencv.hpp>
#include "stdafx.h"
using namespace cv;

int main()
{
    printf("I must confess that I feel like a monster");
    Mat img = imread("lena.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    /*imwrite("output.jpg", img);

    namedWindow("Display window", WINDOW_AUTOSIZE);
    imshow("Display window", img);
    waitKey(0);

    return 0;*/
}

my opencv path C:\fakepath\path.png

my VC++ Directrories setting C:\fakepath\setting.png

my linker setting C:\fakepath\setting2.png C:\fakepath\linkersetting.png

As you can see at first picture that no syntax error show when In coding,but when compiling,there are lots of error C:\fakepath\error.png I suspect that the setting of linker is error,because error happen in compiling. thanks for any help

edit retag flag offensive close merge delete

Comments

please replace the screenshots of code with a TEXT version, thank you.

berak gravatar imageberak ( 2018-07-20 05:30:09 -0500 )edit

include <opencv2 core="" core.hpp="">

#include<opencv2/highgui/highgui.hpp>
#include <cstdio>
#include <opencv2/opencv.hpp>
#include "stdafx.h"
using namespace cv;

int main()
{
    printf("I must confess that I feel like a monster");
    Mat img = imread("lena.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    imwrite("output.jpg", img);

    namedWindow("Display window", WINDOW_AUTOSIZE);
    imshow("Display window", img);
    waitKey(0);

    return 0;
}
sasalicat gravatar imagesasalicat ( 2018-07-21 00:48:34 -0500 )edit

thanks for your reply but I dont think problems happen in codes,because there are no syntax error show before compile I think that are happen in my project setting. there error give me a sence that Visual Studio can not find the library when compile

sasalicat gravatar imagesasalicat ( 2018-07-21 00:55:04 -0500 )edit

however, meant was: EDIT your QUESTION and replace THE SCREENSHOTS with TEXT.

please...

berak gravatar imageberak ( 2018-07-21 02:08:13 -0500 )edit