Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Link to OpenCV library - wrong syntax ?
Link to OpenCV library - wrong syntax ? [message #1747320] Sat, 12 November 2016 02:20 Go to next message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
I have little trouble with syntax linking to OpenCV library
/home/jim/OpenCV/build/lib -shared

or

/home/jim/OpenCV/build/lib

in Library Search Path [-L] should give me an list of libraries to linik [-l] to
There is no list to selecty from
Using 32 bit Ubuntu where "Hello world" compiles and runs fine.

Obviously my syntax is wrong

My "include" path work just fine using same syntax .
Appreciate your time.
Re: Link to OpenCV library - wrong syntax ? [message #1747341 is a reply to message #1747320] Sat, 12 November 2016 16:22 Go to previous messageGo to next message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
Found part of the problem - the install.sh I am using puts OpenCV lib(rary) (_L) in usr/local/lib .
I really do not know why is it in that directory and at this point it does not matter.
However, when I try to specify the (_L) path I get the directory open with sub directories Pythonx which I do not need - since I ma using C++.
But - there are tons of other files with extension .so and they are all grayed out therefore cannot be selected .

What am I missing ? Should there be "shared" / static library option specified somewhere in the "install.sh " script ?
Re: Link to OpenCV library - wrong syntax ? [message #1747356 is a reply to message #1747341] Sun, 13 November 2016 14:54 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
The -L entries tell the linker in what directories to look for library files. The -l entries list the library names to use in the linking process. Notice the difference between the capitalization of the parameters. When editing the library path you must select directories not individual files. You add the individual library names to the libraries section.

Please look at your linker's documentation regarding library naming. You don't always give the explicit name of the file. Linkers perform make adjustments to the library name to find the actual file. For example a library file named libfoo.so will likely be picked up by specifying -lfoo on the linker command line.
Re: Link to OpenCV library - wrong syntax ? [message #1747537 is a reply to message #1747356] Tue, 15 November 2016 18:44 Go to previous message
Anne Creek is currently offline Anne CreekFriend
Messages: 275
Registered: September 2014
Senior Member
OK, this is getting ridiculous.
Why is everybody telling me what the options _L -l do and won't answer the questions?
I can read!
I do not name the library - it is compiled by OpenCV. So why the comment?
Thanks anyway.
Previous Topic:Can't set breakpoints in gdb remote debug
Next Topic:How -shared option works?
Goto Forum:
  


Current Time: Fri Apr 19 02:19:28 GMT 2024

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

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

Back to the top