edrosten / libcvd

libcvd - efficient and easy to use C++ computer vision library.
Other
238 stars 103 forks source link

How can I output a dynamic link lib(.so) in Ubuntu16.04? #51

Closed BKAUTO closed 5 years ago

BKAUTO commented 5 years ago

for cmake it output a libcvd.a. But my project now need a libcvd.so. Thank you!

edrosten commented 5 years ago

I've not done much work on the CMakeLists. The autoconf build will make a .so file.

BKAUTO commented 5 years ago

Yeah but I found maybe the autoconf method failed to check the libjpeg and libpng dependence. I've already generated the .so file by setting the CMakeList, thanks.

heethesh commented 4 years ago

@BKAUTO how did you generate the .so files?

BKAUTO commented 4 years ago

Sorry it's quite a long time and I failed to find the relevant file by now. It is very simple to change the compile target to a .so file(dynamic link) instead of a .a file(static link) in CMake. You may google to find the command and revise it in the CMakeList.txt.

heethesh commented 4 years ago

@BKAUTO Thanks for your reply. I managed to compile the dynamic libs. Had to update the CMake file with this add_library(${PROJECT_NAME} SHARED ${SRCS} ${HEADERS}). Furthermore, I had to manually add these flags -lGL -lGLU -lGLEW -lglut and -lm -lc -lpthread -lX11 in link.txt files generated in my build cmake files folders for some targets to properly link against OpenGL libraries