Создаю библиотеку - пусть будет называться sam.so
В головной программе загружаю, работаю с ней.
Всё хорошо, всё замечательно.
В какой-то момент времени(в какой не понял) она перестала
загружаться, вывел ошибку:
C++ (Qt)
Cannot load library sam.so:( libsam.so: cannot open shared object file: no such file or directory)
Makefile:
#############################################################################
# Makefile for building: libsam.so.1.0.0
# Generated by qmake (2.01a) (Qt 4.8.4) on: ?? ??? 11 18:59:06 2016
# Project: sam.pro
# Template: lib
# Command: /usr/lib/i386-linux-gnu/qt4/bin/qmake -o Makefile sam.pro
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I. -I.
LINK = g++
LFLAGS = -Wl,-O1 -shared -Wl,-soname,sam.so
LIBS = $(SUBLIBS) -L/usr/lib/i386-linux-gnu -L/usr/local/lib -lnet -lpcap -lQtNetwork -lQtCore -lpthread
AR = ar cqs
RANLIB =
QMAKE = /usr/lib/i386-linux-gnu/qt4/bin/qmake
TAR = tar -cf
COMPRESS = gzip -9f
COPY = cp -f
SED = sed
COPY_FILE = $(COPY)
COPY_DIR = $(COPY) -r
STRIP = strip
INSTALL_FILE = install -m 644 -p
INSTALL_DIR = $(COPY_DIR)
INSTALL_PROGRAM = install -m 755 -p
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = mythreadlk.cpp \
mythreadrec.cpp \
sam.cpp \
workrec.cpp \
myftp.cpp moc_mythreadlk.cpp \
moc_mythreadrec.cpp \
moc_workrec.cpp
OBJECTS = mythreadlk.o \
mythreadrec.o \
sam.o \
workrec.o \
myftp.o \
moc_mythreadlk.o \
moc_mythreadrec.o \
moc_workrec.o
DIST = /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/common/gcc-base.conf \
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
/usr/share/qt4/mkspecs/common/g++-base.conf \
/usr/share/qt4/mkspecs/common/g++-unix.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
/usr/share/qt4/mkspecs/features/default_pre.prf \
/usr/share/qt4/mkspecs/features/release.prf \
/usr/share/qt4/mkspecs/features/default_post.prf \
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
/usr/share/qt4/mkspecs/features/warn_on.prf \
/usr/share/qt4/mkspecs/features/qt.prf \
/usr/share/qt4/mkspecs/features/unix/thread.prf \
/usr/share/qt4/mkspecs/features/moc.prf \
/usr/share/qt4/mkspecs/features/resources.prf \
/usr/share/qt4/mkspecs/features/uic.prf \
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
sam.pro
QMAKE_TARGET = sam
DESTDIR =
TARGET = sam.so
TARGETA = libsam.a
TARGETD = sam.so
TARGET0 = libsam.so
TARGET1 = libsam.so.1
TARGET2 = libsam.so.1.0
first: all
####### Implicit rules
.SUFFIXES: .o .c .cpp .cc .cxx .C
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
####### Build rules
all: Makefile $(TARGET)
$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
-ln -s $(TARGET) $(TARGET0)
-ln -s $(TARGET) $(TARGET1)
-ln -s $(TARGET) $(TARGET2)
staticlib: $(TARGETA)
$(TARGETA): $(OBJECTS) $(OBJCOMP)
-$(DEL_FILE) $(TARGETA)
$(AR) $(TARGETA) $(OBJECTS)
Makefile: sam.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/linux.conf \
/usr/share/qt4/mkspecs/common/gcc-base.conf \
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf \
/usr/share/qt4/mkspecs/common/g++-base.conf \
/usr/share/qt4/mkspecs/common/g++-unix.conf \
/usr/share/qt4/mkspecs/qconfig.pri \
/usr/share/qt4/mkspecs/features/qt_functions.prf \
/usr/share/qt4/mkspecs/features/qt_config.prf \
/usr/share/qt4/mkspecs/features/exclusive_builds.prf \
/usr/share/qt4/mkspecs/features/default_pre.prf \
/usr/share/qt4/mkspecs/features/release.prf \
/usr/share/qt4/mkspecs/features/default_post.prf \
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
/usr/share/qt4/mkspecs/features/warn_on.prf \
/usr/share/qt4/mkspecs/features/qt.prf \
/usr/share/qt4/mkspecs/features/unix/thread.prf \
/usr/share/qt4/mkspecs/features/moc.prf \
/usr/share/qt4/mkspecs/features/resources.prf \
/usr/share/qt4/mkspecs/features/uic.prf \
/usr/share/qt4/mkspecs/features/yacc.prf \
/usr/share/qt4/mkspecs/features/lex.prf \
/usr/share/qt4/mkspecs/features/include_source_dir.prf \
/usr/lib/i386-linux-gnu/libQtNetwork.prl \
/usr/lib/i386-linux-gnu/libQtCore.prl
$(QMAKE) -o Makefile sam.pro
/usr/share/qt4/mkspecs/common/unix.conf:
/usr/share/qt4/mkspecs/common/linux.conf:
/usr/share/qt4/mkspecs/common/gcc-base.conf:
/usr/share/qt4/mkspecs/common/gcc-base-unix.conf:
/usr/share/qt4/mkspecs/common/g++-base.conf:
/usr/share/qt4/mkspecs/common/g++-unix.conf:
/usr/share/qt4/mkspecs/qconfig.pri:
/usr/share/qt4/mkspecs/features/qt_functions.prf:
/usr/share/qt4/mkspecs/features/qt_config.prf:
/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
/usr/share/qt4/mkspecs/features/default_pre.prf:
/usr/share/qt4/mkspecs/features/release.prf:
/usr/share/qt4/mkspecs/features/default_post.prf:
/usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
/usr/share/qt4/mkspecs/features/warn_on.prf:
/usr/share/qt4/mkspecs/features/qt.prf:
/usr/share/qt4/mkspecs/features/unix/thread.prf:
/usr/share/qt4/mkspecs/features/moc.prf:
/usr/share/qt4/mkspecs/features/resources.prf:
/usr/share/qt4/mkspecs/features/uic.prf:
/usr/share/qt4/mkspecs/features/yacc.prf:
/usr/share/qt4/mkspecs/features/lex.prf:
/usr/share/qt4/mkspecs/features/include_source_dir.prf:
/usr/lib/i386-linux-gnu/libQtNetwork.prl:
/usr/lib/i386-linux-gnu/libQtCore.prl:
qmake: FORCE
@$(QMAKE) -o Makefile sam.pro
dist:
@$(CHK_DIR_EXISTS) .tmp/sam1.0.0 || $(MKDIR) .tmp/sam1.0.0
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/sam1.0.0/ && $(COPY_FILE) --parents mythreadlk.h mythreadrec.h sam.h sam_global.h workrec.h myftp.h .tmp/sam1.0.0/ && $(COPY_FILE) --parents mythreadlk.cpp mythreadrec.cpp sam.cpp workrec.cpp myftp.cpp .tmp/sam1.0.0/ && (cd `dirname .tmp/sam1.0.0` && $(TAR) sam1.0.0.tar sam1.0.0 && $(COMPRESS) sam1.0.0.tar) && $(MOVE) `dirname .tmp/sam1.0.0`/sam1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/sam1.0.0
clean:compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
####### Sub-libraries
distclean: clean
-$(DEL_FILE) $(TARGET)
-$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA)
-$(DEL_FILE) Makefile
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: moc_mythreadlk.cpp moc_mythreadrec.cpp moc_workrec.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_mythreadlk.cpp moc_mythreadrec.cpp moc_workrec.cpp
moc_mythreadlk.cpp: myftp.h \
sam_global.h \
mythreadlk.h
/usr/lib/i386-linux-gnu/qt4/bin/moc $(DEFINES) $(INCPATH) mythreadlk.h -o moc_mythreadlk.cpp
moc_mythreadrec.cpp: myftp.h \
sam_global.h \
mythreadrec.h
/usr/lib/i386-linux-gnu/qt4/bin/moc $(DEFINES) $(INCPATH) mythreadrec.h -o moc_mythreadrec.cpp
moc_workrec.cpp: workrec.h
/usr/lib/i386-linux-gnu/qt4/bin/moc $(DEFINES) $(INCPATH) workrec.h -o moc_workrec.cpp
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all:
compiler_uic_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean
####### Compile
mythreadlk.o: mythreadlk.cpp mythreadlk.h \
myftp.h \
sam_global.h \
sam.h \
mythreadrec.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mythreadlk.o mythreadlk.cpp
mythreadrec.o: mythreadrec.cpp mythreadrec.h \
myftp.h \
sam_global.h \
sam.h \
mythreadlk.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mythreadrec.o mythreadrec.cpp
sam.o: sam.cpp sam.h \
sam_global.h \
mythreadrec.h \
myftp.h \
mythreadlk.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o sam.o sam.cpp
workrec.o: workrec.cpp workrec.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o workrec.o workrec.cpp
myftp.o: myftp.cpp myftp.h \
sam.h \
sam_global.h \
mythreadrec.h \
mythreadlk.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o myftp.o myftp.cpp
moc_mythreadlk.o: moc_mythreadlk.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mythreadlk.o moc_mythreadlk.cpp
moc_mythreadrec.o: moc_mythreadrec.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mythreadrec.o moc_mythreadrec.cpp
moc_workrec.o: moc_workrec.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_workrec.o moc_workrec.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
ничё не понимаю