Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7941595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:43:02+00:00 2026-06-03T23:43:02+00:00

I am doing a project, the main program write in C, it’s on a

  • 0

I am doing a project, the main program write in C, it’s on a embedded Linux system. the hardware supplied by another company, there I got their libs(static libs both in c and c++ language).for later porting to other devices, I made new libs(shared libs) to link with the applications which in c language,that is:

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

All the c static libs works good for me, when doing with c++ libs, my libs compiled good, but 2 errors come out when linking to my applications:

libplate.so: undefined reference to operator delete(void*)
libplate.so: undefined reference to vtable for __cxxabiv1::__class_type_info

here are the makefile parts for compile this shared lib.

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++

I have added options for CPPFLAGS like (-fno-rtti -fno-exceptions), they don’t work

For application, since all libs compiled in c language, I made my makefile belown:

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 $<

I have tried add some other system libs(-ldl -lc) it doesn’t works.

PS: the c++ static lib works just fine when I link this lib direct to c programs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:43:04+00:00Added an answer on June 3, 2026 at 11:43 pm

    You need to compile your shared library with g++. Also, you made a mistake with -fPCI. Should be -fPIC. Either that, or for some strange reason you retyped your Makefile here instead of using cut and paste.

    So, the line should look like:

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

    Compiling with g++ links the support libraries that C++ needs as well as making sure to include important information such as type information classes and exceptions.

    If their C++ library that you are linking to uses RTTI or exceptions, you will need to link those in. Giving the flags -fno-rtti or -fno-exceptions during the shared object link will only break the program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing project in cakephp . I want to write below query in
I've inherited a medium sized project in which the main (batch) program is fed
I am doing a project in linux kernel and I wanted to know what
I am doing project euler question 33 and have divised a refactor to solve
After doing a project with WPF and getting very much attached to it's excellent
Im doing a project with C# winforms. This project is composed by: alt text
Im doing this project where i need to download files through a webservice (images,
Im doing a project where Alice and Bob send each other messages using the
I am doing a project where I want a person to enter the name
I'm currently doing a project in C# working with windows forms. During the course

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.