Ask Your Question
-1

fatal error LNK1120: 10 unresolved externals

asked 2012-12-14 08:10:10 -0600

budong gravatar image

Need some help :/ i face some error after trying to release a simple program. wasted my whole day from one problem till the other...

1>main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::namedWindow(class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &,int)" (?namedWindow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) 1>main.obj : error LNK2001: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z) 1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::_InputArray::_InputArray(class cv::Mat const &)" (??0_InputArray@cv@@QEAA@AEBVMat@1@@Z) 1>main.obj : error LNK2001: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@YAXPEAX@Z) 1>main.obj : error LNK2001: unresolved external symbol "public: void __cdecl cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QEAAXXZ) 1>main.obj : error LNK2001: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd@cv@@YAHPEAHH@Z) 1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::VideoCapture::open(int)" (?open@VideoCapture@cv@@UEAA_NH@Z) 1>main.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UEAA@XZ) 1>main.obj : error LNK2001: unresolved external symbol "public: __cdecl cv::VideoCapture::VideoCapture(void)" (??0VideoCapture@cv@@QEAA@XZ) 1>main.obj : error LNK2001: 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 &)" (?imshow@cv@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@1@@Z) 1>C:\Users\Steven\Documents\Visual Studio 2010\Projects\mynewproject\x64\Release\mynewproject.exe : fatal error LNK1120: 10 unresolved externals 1> 1>Build FAILED. 1>

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2012-12-15 07:46:50 -0600

unxnut gravatar image

OK, you have set up the directories for Debug but not for Release. In Project Configuration, select the Release configuration and set up the directory paths. Another thing. OpenCV names the Debug library files ending with d (highguixxxd.lib) while the Release versions are without the d (highguixxx.lib) where xxx is the version number. You obviously know how to specify those in additional library setting.

edit flag offensive delete link more

Comments

I am sorry, i dont get you, the things you said i have done it.

budong gravatar imagebudong ( 2012-12-15 20:30:50 -0600 )edit

Well, we need to start from the basic. Sometime, I find that we overlook the obvious. Can you verify that the version numbers of the libraries are correct? I kind of get a feeling that I do not know your level of expertise. For example, I am not sure if you are a novice or someone who has already a lot of coding under his belt, a good understanding of the compilation/linking process, and just starting to work in OpenCV. I may be able to better answer your question if I know a bit more about your level, and exactly what you have done so far.

unxnut gravatar imageunxnut ( 2012-12-16 08:22:40 -0600 )edit
0

answered 2012-12-14 08:20:28 -0600

ubehagelig gravatar image

I think the problem might be your Library Directories path.

I would think your library path in Library Directories would be something like C:\opencv\build\x64\vc10\lib

edit flag offensive delete link more

Comments

yes, D:\OpenCV243\build\x64\vc10\lib;

is there a problem?

budong gravatar imagebudong ( 2012-12-14 08:35:39 -0600 )edit

Ok, good. New question: Are you sure you started a Console Application? Try this: Start a new project and make sure you choose Win32 Console Application. Then paste your current code back in, and remember to change from Win32 to x64 in the Configuration Manager. Compile and see if it solved it.

ubehagelig gravatar imageubehagelig ( 2012-12-14 09:02:00 -0600 )edit

yes it is console application. i have no problem with debug, and i have remove the d's for release. but the errors are there :/

budong gravatar imagebudong ( 2012-12-14 10:20:09 -0600 )edit

Question Tools

Stats

Asked: 2012-12-14 08:10:10 -0600

Seen: 9,485 times

Last updated: Dec 15 '12