bubble
bubble

Reputation: 3526

How to resolve this linker error?

I am trying to use a compiled library inside an Eclipse project. The compilation goes fine but during linking i get an error. Below is the verbose generated on eclipse console.

g++ -L/usr/local/lib -o "readInput" ./readInput.o -llibopencv_calib3d.so -llibopencv_contrib.so -llibopencv_core.so

/usr/bin/ld: cannot find -llibopencv_calib3d.so  
/usr/bin/ld: cannot find -llibopencv_contrib.so  
/usr/bin/ld: cannot find -llibopencv_core.so

I dont know even after providing the library paths why is the linker giving error that it could not find it.

Upvotes: 4

Views: 236

Answers (1)

Anton Kovalenko
Anton Kovalenko

Reputation: 21507

Assuming you have all required libraries: for libSOMETHING.so, specify -lSOMETHING instead of -llibSOMETHING.so. Omit the initial lib and final .so.

Upvotes: 6

Related Questions