2012-03-26 14 views
8

पर बिल्ड मैं इस tutorial यहाँ का पालन किया है के रूप में वास्तव में उल्लेख कियाOpenCV दृश्य स्टूडियो लिंक त्रुटि

मैं अब दृश्य स्टूडियो पर सरल OpenCV कोड चलाने की कोशिश, लेकिन यह मैं लिंकर त्रुटियों मिलती रहती है।

1>Linking... 
1>LINK : warning LNK4067: ambiguous entry point; selected 'mainCRTStartup' 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" ([email protected]@@[email protected]) referenced in function _main 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) referenced in function _main 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::_InputArray::_InputArray(class cv::Mat const &)" ([email protected]@@[email protected]@[email protected]@Z) referenced in function _main 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) referenced in function _main 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "class cv::Mat __cdecl cv::imread(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" ([email protected]@@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) referenced in function _main 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" ([email protected]@@[email protected]) referenced in function "public: __thiscall cv::Mat::~Mat(void)" ([email protected]@@[email protected]) 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::copySize(class cv::Mat const &)" ([email protected]@[email protected]@[email protected]@Z) referenced in function "public: class cv::Mat & __thiscall cv::Mat::operator=(class cv::Mat const &)" ([email protected]@@[email protected]@@Z) 
1>OpenCV_Proj.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" ([email protected]@[email protected]@QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" ([email protected]@[email protected]@QAEXXZ) 
1>C:\Users\Saher\Documents\Visual Studio 2008\Projects\OpenCV_Proj\Debug\OpenCV_Proj.exe : fatal error LNK1120: 8 unresolved externals`` 

निम्न कोड के लिए::

// OpenCV_Proj.cpp : Defines the entry point for the console application. 

//

#include "stdafx.h" 
#include <opencv2/core/core.hpp> 
#include <opencv2/highgui/highgui.hpp> 
#include <iostream> 

using namespace cv; 
using namespace std; 

int main(int argc, char** argv) 
{ 
    if(argc != 2) 
    { 
    cout <<" Usage: display_image ImageToLoadAndDisplay" << endl; 
    return -1; 
    } 

    Mat image; 
    image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file 

    if(! image.data)        // Check for invalid input 
    { 
     cout << "Could not open or find the image" << std::endl ; 
     return -1; 
    } 

    namedWindow("Display window", CV_WINDOW_AUTOSIZE);// Create a window for display. 
    imshow("Display window", image);     // Show our image inside it. 

    waitKey(0);           // Wait for a keystroke in the window 
    return 0; 
} 

int _tmain(int argc, _TCHAR* argv[]) 
{ 
    return 0; 
} 

मैं कर दिया गया है मैं इस OpenCV tutorial in particular

यहाँ कोशिश कर रहा हूँ त्रुटि मैं बार आ रही है है थोड़ी देर के लिए वीएस 2008 के लिए ओपनसीवी काम करने की कोशिश कर रहा है और इसके बारे में कोई मदद है इस मुद्दे को पुनर्निर्मित किया जाएगा।

नोट: ट्यूटोरियल निम्न में से रीडमी फ़ाइल में मैं क्या पीछा किया है:

1) Add build\bin and one of build\{x86|x64}\{vc9\vc10\mingw}\bin to your system path (to use DLLs) 
    Add build\{x86|x64}\{vc9\vc10\mingw}\lib or 
     build\{x86|x64}\{vc9\vc10\mingw}\staticlib as library directories to your linker settings, 
    Add build\include and build\include\opencv as include directories to your compiler settings. 



Any help with getting this to work is really appreciated. 

उत्तर

8

उन प्रतीकों OpenCV पुस्तकालयों के अंदर परिभाषित कर रहे हैं, तो आप इस परियोजना कॉन्फ़िगर और लिंकर बताने की आवश्यकता है जो OpenCV पुस्तकालय आप उपयोग कर रहे हैं।

बहुत कम आप जोड़ना चाहिए पर: opencv_core230.lib और opencv_highgui230.lib

कैसे VS2010, check this tutorial पर यह करने के लिए अधिक जानकारी के लिए (OpenCV 2.3.0 के लिए)।

+0

धन्यवाद। जिसने लिंकर समस्याओं को हल किया –

+0

हाय, मेरे पास एक सवाल है ... यदि हम सीएमके 2010 प्रोजेक्ट का निर्माण करते हैं तो क्या यह सभी निर्भरताओं को नहीं बना सकता ...? मुझे अभी भी एक ही त्रुटि मिलती है – user1036908

2

जाओ गुण के लिए> Linker-> इनपुट और

cv210.lib जोड़ने; cxcore210.lib; highgui210.lib; cvaux210.lib;

आपकी समस्या हल हो जाएगी।

एक खुश कोडिंग है ....

+0

धन्यवाद कि लिंकर समस्या समस्या हल हो गई है। –

संबंधित मुद्दे