Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » OpenCV link problem. Eclipse Juno(collect2: ld returned 1 exit status)
OpenCV link problem. Eclipse Juno [message #961907] Sun, 28 October 2012 18:00 Go to next message
Felipe Garcia is currently offline Felipe Garcia
Messages: 4
Registered: October 2012
Junior Member
Hi,

I can't configure Eclipse properly with OpenCV. Thus I have this problem when linking:

18:57:23 **** Incremental Build of configuration Build (GNU) for project hello01 ****
make all
Making all in src
make[1]: Entering directory `/home/lipiss/workspace/hello01/src'
g++ -g -O2 -o a.out hello01.o
hello01.o: In function `main':
/home/lipiss/workspace/hello01/src/hello01.cpp:55: undefined reference to `cvLoadImage'
make[1]: Leaving directory `/home/lipiss/workspace/hello01/src'
/home/lipiss/workspace/hello01/src/hello01.cpp:65: undefined reference to `cvNamedWindow'
/home/lipiss/workspace/hello01/src/hello01.cpp:68: undefined reference to `cvShowImage'
/home/lipiss/workspace/hello01/src/hello01.cpp:71: undefined reference to `cvWaitKey'
/home/lipiss/workspace/hello01/src/hello01.cpp:74: undefined reference to `cvDestroyWindow'
/home/lipiss/workspace/hello01/src/hello01.cpp:75: undefined reference to `cvReleaseImage'
collect2: ld returned 1 exit status
make[1]: *** [a.out] Error 1
make: *** [all-recursive] Error 1


Can someone tell me the configuration to resolve this linking issue please?

Thank you in advance

Felipe
Re: OpenCV link problem. Eclipse Juno [message #962631 is a reply to message #961907] Mon, 29 October 2012 07:56 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
You have to link your application against the OpenCV lib.
http://wiki.eclipse.org/CDT/User/FAQ#Adding_C.2FC.2B.2B_External_Libraries


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: OpenCV link problem. Eclipse Juno [message #963225 is a reply to message #962631] Mon, 29 October 2012 17:01 Go to previous messageGo to next message
Felipe Garcia is currently offline Felipe Garcia
Messages: 4
Registered: October 2012
Junior Member
Hi,

Yes. I am aware that I have to link my application against the required lib.

4:26, 18 December 2007 (EST): Neither of these worked for me under Linux. I had to open up the project's properties and go to "C/C++ Build" -> "Settings" and then hit the "Libraries" item under "GCC C++ Linker" heading in the list on the right.

Thank you for the reference. But I think the version Juno is not like that anymore. If someone could tell me how to configure it please? I have no clue where to introduce the libraries.



Re: OpenCV link problem. Eclipse Juno [message #964204 is a reply to message #963225] Tue, 30 October 2012 10:39 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
Felipe Garcia wrote on Mon, 29 October 2012 18:01


Thank you for the reference. But I think the version Juno is not like that anymore. If someone could tell me how to configure it please? I have no clue where to introduce the libraries.

There is no difference in the Juno version.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: OpenCV link problem. Eclipse Juno [message #965004 is a reply to message #964204] Tue, 30 October 2012 23:59 Go to previous messageGo to next message
Felipe Garcia is currently offline Felipe Garcia
Messages: 4
Registered: October 2012
Junior Member
In the properties menu I can't see: Project->Properties->Tool Settings Tab->C++ Linker->Miscellaneous

That is what I mean. Juno is different. I attached a screenshot to just let you see.

Thank you !
Re: OpenCV link problem. Eclipse Juno [message #965048 is a reply to message #965004] Wed, 31 October 2012 00:49 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1341
Registered: July 2009
Senior Member
On 10/30/2012 06:59 PM, Felipe Garcia wrote:
> In the properties menu I can't see: Project->Properties->Tool Settings Tab->C++ Linker->Miscellaneous
>
> That is what I mean. Juno is different. I attached a screenshot to just let you see.
>
> Thank you !
>
Is your project a Makefile project or a Managed project (check the
Makefile generation section on the C++ Build properties). If it is a
Makefile project, you have to add the library to the Makefile. I
believe only Managed projects have the Tools tab.
Re: OpenCV link problem. Eclipse Juno [message #965418 is a reply to message #965004] Wed, 31 October 2012 08:08 Go to previous messageGo to next message
Axel Mueller is currently offline Axel Mueller
Messages: 1952
Registered: July 2009
Senior Member
Felipe Garcia wrote on Wed, 31 October 2012 00:59
In the properties menu I can't see: Project->Properties->Tool Settings Tab->C++ Linker->Miscellaneous

That is what I mean. Juno is different. I attached a screenshot to just let you see.

Thank you !

Juno is not different. Your configuration is different. You configured Eclipse to use your own Makefile. You will only get the above Settings Tab when you activate "Generate Makefiles automatically" in Project Properties->C/C++ Build. Then Eclipse will create the Makefiles and you can configure them.
Please have a look at the CDT help first!


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: OpenCV link problem. Eclipse Juno [message #969886 is a reply to message #965418] Sat, 03 November 2012 16:57 Go to previous message
Felipe Garcia is currently offline Felipe Garcia
Messages: 4
Registered: October 2012
Junior Member
Totally true!!

That was my problem. When generating the project: Project Type => Makefile Project, and then Generate Makefiles Automatically.

My fault.

Thanks!!!! Rolling Eyes
Previous Topic:Formatter and command line
Next Topic:Eclipse CDT + Linux Mint won't recognize some OpenGL functions
Goto Forum:
  


Current Time: Sun Sep 21 06:24:59 GMT 2014

Powered by FUDForum. Page generated in 0.09067 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software