Can't I build another version?

asked 2020-04-01 07:41:20 -0600

jhj gravatar image

I have version opencv4.1 and my co-worker have version opencv4.3. I made a shared library with opencv and gave it to him. But he got this error.

when compile

/usr/bin/ld: warning: libopencv_imgproc.so.4.1, needed by lib/libgbhealth.so, not found (try using -rpath or -rpath-link) /usr/bin/ld: warning: libopencv_core.so.4.1, needed by lib/libgbhealth.so, not found (try using -rpath or -rpath-link)

when runtime

error while loading shared libraries: libopencv_imgproc.so.4.1: cannot open shared object file: No such file or directory

ldconfig is registered and also has an openv.conf in ll /etc/ld.so.conf.d/ But when ldconfig -p | grep imgproc, There was no indication of libopencv_imgproc.so.4.1.

Then, is the library that I made available only in version 4.1 of openv?

edit retag flag offensive close merge delete

Comments

Yes you can, but not on same currently folder. Created another folder.

supra56 gravatar imagesupra56 ( 2020-04-01 15:40:58 -0600 )edit

@supra56 Thank you for your reply You mean that if I make a library with version 4.1, a co-worker with version 4.3 should build version 4.1 openv separately and have it in a different folder?

jhj gravatar imagejhj ( 2020-04-01 20:19:54 -0600 )edit

is the library that I made available only in version 4.1 of openv?

youre trying to distribute a binary which depends on opencv4.1 libs (on the machine it has to run on)

why even do this ? distribute src code, that ppl can build against their local libs !

or make everyone use the same version (that's what git is for, no ?)

you can also build static libs/executables, which no more need opencv so's at runtime

berak gravatar imageberak ( 2020-04-02 02:20:17 -0600 )edit
1

@berak Because I want to create a library that is not related to the user version,
but people with different versions of openv don't seem to be able to use my library. Like you said, I made a static library.
I think I've never heard of ppl. I'll have to study it. Thank you! That was very helpful.

jhj gravatar imagejhj ( 2020-04-02 21:38:06 -0600 )edit

Like you said, I made a static library.

no, meant was : build static opencv libs, and link yours against that,

then you don't need another opencv install on the other machine

berak gravatar imageberak ( 2020-04-03 01:23:47 -0600 )edit
1

Aha, I understand. When I build an opencv, I'll use "cmake -DBUILD_SHARED_LIBS=OFF .." to build.

jhj gravatar imagejhj ( 2020-04-03 07:47:24 -0600 )edit

@jhj.Do you meant DLL(Dynamic Link Library)?

  • I have version opencv4.1 and my co-worker have version opencv4.3

No. You can't do that. Every new version of OpenCV x.x had new library. But it will not work to shared your friend. Sorry, I misread your first question.

supra56 gravatar imagesupra56 ( 2020-04-03 21:31:17 -0600 )edit