Linux C program using shared libraries written in c / C ++

I am doing a project, the main program is writing in C, this is on the embedded Linux system. the hardware supplied by another company, there I got my libraries (static libraries in both c and C ++). For a later transfer to other devices, I created new libraries (shared libraries) to communicate with applications that are in c,

 their libs(static libs,c/c++) --> my libs(shared libs,c) --> my applications(c).

All c static libs work well for me, when you work with C ++ libs, my libraries compiled well, but when linking to my applications 2 errors occur:

libplate.so: undefined link to operator delete(void*)
libplate.so: undefined link tovtable for __cxxabiv1::__class_type_info

here are the makefiles for compiling this shared library.

CFLAGS = -Wall -mlittle-endian -I$(INC_PATH)/plate
CPPFLAGS = -Wall -mlittle-endian -I$(PLAT_PATH)/include/sfc -I$(INC_PATH)/plate
OBJ = $(patsubst %.c, %.o, $(SRC)) 
OBJ += $(patsubst %.cpp,%.o,$(SOURCPP))

$(D_LIB):$(OBJ)

$(CC) -o $(D_LIB)  -lm -lpthread -lc -shared -fPCI $(OBJ) $(LIB)
$(STRIP) -s $(D_LIB)

%.o : %.c 
$(CC) $(CFLAGS) -c $<

#CC use gcc

%.o :%.cpp
    $(CXX) $(CPPFLAGS)  -c $< 

#CXX use g ++

CPPFLAGS (-fno-rtti -fno-exceptions),

, libs, c, makefile:

CFLAGS = -Wall -I$(INC_PATH)/logic ->I$(INC_PATH)/plate

$(BIN):$(OBJ)

$(CC) -o $(BIN) $(OBJ) -Wl,-rpath,$(LD_RUN_PATH) $(LIBS)

%.o : %.c 

$(CC) $(CFLAGS) -c $<

(-ldl -lc), .

PS: ++ static lib , lib c .

+3
1

g++. , -fPCI. -fPIC. , - Makefile .

, :

$(D_LIB):$(OBJ)
    $(CXX) -o $(D_LIB) -lm -lpthread -shared -fPIC $(OBJ) $(LIB)

g++ , ++, , .

++, , RTTI , . -fno-rtti -fno-exceptions .

+4

All Articles