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

  • Home
  • SEARCH
  • 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 6252875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:53:08+00:00 2026-05-24T13:53:08+00:00

I try to write a webserver. As far as I am, it works quiet

  • 0

I try to write a webserver. As far as I am, it works quiet good with Windows. But I want to make it also Unix compatible. And I think there has to be a problem with the heredity f the exception class.
For better understanding, just the important parts:

server.cpp

#include <exception>
#include <stdexcept>

#ifdef __unix__
    #include "UnixSocket.h"
#elif __WIN32__ || _MSC_VER
    #include "WinSocket.h"
#endif

#include "HTTPParser.h"

int main(void) {
    try {
        socket->socketInit(PORT);
    }
    catch (exception &e) {
        cout << endl << "Exception: " << e.what() << endl;
        socket->cleanAll();
    }
return 0
}

NetInterface.h

class NetInterface : public exception {

private:

public:
    virtual void socketInit(const char *port) = 0;
    virtual void cleanAll(void) = 0;
    virtual void cleanPersCon(void) = 0;
    virtual char *akzeptieren(void) = 0;
    virtual void empfangen(void) = 0;
    virtual void senden(void) = 0;
    virtual void *get_in_addr(struct sockaddr *sa) = 0;
    virtual string getIncoming(void) = 0;
    virtual void setOutcoming(string s) = 0;

    virtual ~NetInterface() throw() {};

};

UnixSocket.h

class UnixSocket : virtual public NetInterface { 
private: 
    [...]
public:
    UnixSocket(void);
//kill socket connections
    void cleanAll(void);
    void cleanPersCon(void);
//SysCalls
    void socketInit(const char *port);
    char *akzeptieren(void);
    void empfangen(void);
    void senden(void);
//Getter and Setter
    string getIncoming(void);
    void setOutcoming(string s);

    virtual ~UnixSocket() throw() {};
};

HTTPParser.h

class HTTPParser : public exception {
private:
    [...]

public:
    HTTPParser(NetInterface *_socket, string _path);
    void parsePacket(void);

    virtual ~HTTPParser() throw() {};
};

There you can se a short summary of the class declarations.
But now the gcc tells me something like this:

/tmp/cc8DNmKI.o:(.rodata._ZTV10HTTPParser[vtable for HTTPParser]+0x10): undefined reference to `std::exception::what() const'
/tmp/cc8DNmKI.o:(.rodata._ZTV10UnixSocket[vtable for UnixSocket]+0x14): undefined reference to `std::exception::what() const'
/tmp/cc8DNmKI.o:(.rodata._ZTV10UnixSocket[vtable for UnixSocket]+0x78): undefined reference to `std::exception::what() const'
/tmp/cc8DNmKI.o:(.rodata._ZTV12NetInterface[vtable for NetInterface]+0x10): undefined reference to `std::exception::what() const'
/tmp/cc8DNmKI.o:(.rodata._ZTV12NetInterface[vtable for NetInterface]+0x14): undefined reference to `__cxa_pure_virtual'
/tmp/cc8DNmKI.o:(.rodata._ZTV12NetInterface[vtable for NetInterface]+0x18): undefined reference to `__cxa_pure_virtual'
/tmp/cc8DNmKI.o:(.rodata._ZTV12NetInterface[vtable for NetInterface]+0x1c): undefined reference to `__cxa_pure_virtual'
/tmp/cc8DNmKI.o:(.rodata._ZTV12NetInterface[vtable for NetInterface]+0x20): undefined reference to `__cxa_pure_virtual'
/tmp/cc8DNmKI.o:(.rodata._ZTV12NetInterface[vtable for NetInterface]+0x24): undefined reference to `__cxa_pure_virtual'
/tmp/cc8DNmKI.o:(.rodata._ZTV12NetInterface[vtable for NetInterface]+0x28): more undefined references to `__cxa_pure_virtual' follow
/tmp/cc8DNmKI.o:(.rodata._ZTVSt16invalid_argument[vtable for std::invalid_argument]+0x10): undefined reference to `std::logic_error::what() const'
/tmp/cc8DNmKI.o:(.rodata._ZTVSt12domain_error[vtable for std::domain_error]+0x10): undefined reference to `std::logic_error::what() const'
/tmp/cc8DNmKI.o:(.rodata._ZTI10HTTPParser[typeinfo for HTTPParser]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/cc8DNmKI.o:(.rodata._ZTI10HTTPParser[typeinfo for HTTPParser]+0x8): undefined reference to `typeinfo for std::exception'
/tmp/cc8DNmKI.o:(.rodata._ZTI10UnixSocket[typeinfo for UnixSocket]+0x0): undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'
/tmp/cc8DNmKI.o:(.rodata._ZTI10UnixSocket[typeinfo for UnixSocket]+0x18): undefined reference to `typeinfo for std::exception'
/tmp/cc8DNmKI.o:(.rodata._ZTI12NetInterface[typeinfo for NetInterface]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/cc8DNmKI.o:(.rodata._ZTI12NetInterface[typeinfo for NetInterface]+0x8): undefined reference to `typeinfo for std::exception'
/tmp/cc8DNmKI.o:(.rodata._ZTISt16invalid_argument[typeinfo for std::invalid_argument]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/cc8DNmKI.o:(.rodata._ZTISt16invalid_argument[typeinfo for std::invalid_argument]+0x8): undefined reference to `typeinfo for std::logic_error'
/tmp/cc8DNmKI.o:(.rodata._ZTISt12domain_error[typeinfo for std::domain_error]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/tmp/cc8DNmKI.o:(.rodata._ZTISt12domain_error[typeinfo for std::domain_error]+0x8): undefined reference to `typeinfo for std::logic_error'
/tmp/cc8DNmKI.o:(.eh_frame+0xeb): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

and even more….

  • 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-05-24T13:53:09+00:00Added an answer on May 24, 2026 at 1:53 pm

    Judging from undefined reference to __gxx_personality_v0 linker message it looks like you are linking with gcc. You need to link C++ applications with g++. Or link with gcc and add -lstdc++ to the linker command line.

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

Sidebar

Related Questions

I try to write to a large file, but it seems like it does
I try to write a simple Markdown parser in JavaScript. Therefore I want to
I try to write :ab in Vim for faster coding but the question is
I try to write a site with CodeIgniter but I've a problem with PHP.
I try to write KSH script for processing a file consisting of name-value pairs,
I try to write a simple client/server application (all application is a bluetooth service
I try to write a macro in clojure that sets up a namespace and
I try to write a simple user script to enlarge the picture when you
I try to write the following in latex: \begin{itemize} \item \textbf{insert(element|text)} inserts the element
Whenever I try to write graphical programs (whether a game or really any GUI

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.