I added a hpp and cpp into darknet. And add them into Makefile like modified https://github.com/AlexeyAB/darknet/blob/cce34712f6928495f1fbc5d69332162fc23491b9/Makefile#L135 to "
$(LIBNAMESO): $(OBJS) include/yolo_v2_class.hpp src/yolo_v2_class.cpp include/usw.hpp src/usw.cpp
$(CPP) -shared -std=c++11 -fvisibility=hidden -DLIB_EXPORTS $(COMMON) $(CFLAGS) $(OBJS) src/yolo_v2_class.cpp src/usw.cpp -o $@ $(LDFLAGS)
"
https://github.com/AlexeyAB/darknet/blob/cce34712f6928495f1fbc5d69332162fc23491b9/Makefile#L138
to
"
$(APPNAMESO): $(LIBNAMESO) include/yolo_v2_class.hpp include/usw.hpp src/yolo_console_dll.cpp
$(CPP) -std=c++11 $(COMMON) $(CFLAGS) -o $@ src/yolo_console_dll.cpp $(LDFLAGS) -L ./ -l:$(LIBNAMESO)
"
No accidents occurred at compile time, just a little warning like not unstrict use of variables.
When using it by "LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./uselib name yolov3-tiny.cfg yolov3-tiny_last.weights validimage.list"
There is a problem like "
bash uselib.sh
./uselib: error while loading shared libraries: libdarknet.so: cannot open shared object file: No such file or directory
"
I'm sure that uselib and libdarknet.so are in the same folder.
I regit the project and redo it again.... then it solved... dark magic?
Before you compile, open Makefile and change "LIBSO=1"
Hai @aimhabo im having the same issue as yours.. can you describe how u solved it? thanks
@hanifjunos I just recompiled it again.
@aimhabo thanks for the reply. May i know what is usw.cpp and usw.hpp file? i cant find it in the original repo.
@hanifjunos That is my project's API。
Most helpful comment
Before you compile, open Makefile and change "LIBSO=1"