0

Trying to compile an example from the "Learning OpenCV" book, I got the following errors (How can I fix them?):

> 1>playVideo.obj : error LNK2005: _main
> already defined in imageload.obj
> 1>C:\Users\avbder\Documents\Visual
> Studio
> 2008\Projects\opencv\Debug\opencv.exe
> : fatal error LNK1169: one or more
> multiply defined symbols found 1>Build
> log was saved at
> "file://c:\Users\avbder\Documents\Visual
> Studio
> 2008\Projects\opencv\opencv\Debug\BuildLog.htm"
> 1>opencv - 2 error(s), 0 warning(s)
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
> ==========

Thanks.

2 Answers 2

2

You have two main() definitions. One in playVedio.cpp and the other in imageload.cpp. Try deleting one of them. Or you can post your codes here and let's see what can be done to fix it.

Sign up to request clarification or add additional context in comments.

Comments

1

So both playVideo.obj and imageload.obj defines the main function. You need to investigate which one you need. Perhaps there is some define to set or you have included some file too much.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.