Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Compiling Error undefined reference.

Help
Mnouh
2011-04-29
2013-04-25
  • Mnouh
    Mnouh
    2011-04-29

    Hello,

    I'm getting errors compiling, undefined reference:
    Platform I'm using: Ubuntu 64 bit, I have SSL, TLS installed as well as the other libraries.
    My Compiler is: GNU GCC(G++)

    How do I please fix this problem.
    Thank You
    Mo

    rad@ubuntu:~/Desktop/libvmime-0.9.1/examples$ g++ example6.cpp -o example6 `pkg-config libvmime`
    /tmp/cc1Z40dn.o: In function `findAvailableProtocols(vmime::net::service::Type)':
    example6.cpp:(.text+0xe): undefined reference to `vmime::net::serviceFactory::getInstance()'
    example6.cpp:(.text+0x53): undefined reference to `vmime::net::serviceFactory::getServiceAt(int) const'
    example6.cpp:(.text+0xe2): undefined reference to `vmime::net::serviceFactory::getServiceCount() const'
    /tmp/cc1Z40dn.o: In function `operator<<(std::basic_ostream<char, std::char_traits<char> >&, vmime::exception const&)':
    example6.cpp:(.text+0x1e2): undefined reference to `typeinfo for vmime::exceptions::command_error'
    example6.cpp:(.text+0x1ea): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x20d): undefined reference to `typeinfo for vmime::exceptions::command_error'
    example6.cpp:(.text+0x215): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x232): undefined reference to `vmime::exceptions::command_error::command() const'
    example6.cpp:(.text+0x26e): undefined reference to `vmime::exceptions::command_error::response() const'
    example6.cpp:(.text+0x2c0): undefined reference to `typeinfo for vmime::exceptions::invalid_response'
    example6.cpp:(.text+0x2c8): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x2e7): undefined reference to `typeinfo for vmime::exceptions::invalid_response'
    example6.cpp:(.text+0x2ef): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x30c): undefined reference to `vmime::exceptions::invalid_response::response() const'
    example6.cpp:(.text+0x35e): undefined reference to `typeinfo for vmime::exceptions::connection_greeting_error'
    example6.cpp:(.text+0x366): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x385): undefined reference to `typeinfo for vmime::exceptions::connection_greeting_error'
    example6.cpp:(.text+0x38d): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x3aa): undefined reference to `vmime::exceptions::connection_greeting_error::response() const'
    example6.cpp:(.text+0x3fc): undefined reference to `typeinfo for vmime::exceptions::authentication_error'
    example6.cpp:(.text+0x404): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x423): undefined reference to `typeinfo for vmime::exceptions::authentication_error'
    example6.cpp:(.text+0x42b): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x448): undefined reference to `vmime::exceptions::authentication_error::response() const'
    example6.cpp:(.text+0x49a): undefined reference to `typeinfo for vmime::exceptions::filesystem_exception'
    example6.cpp:(.text+0x4a2): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x4c5): undefined reference to `typeinfo for vmime::exceptions::filesystem_exception'
    example6.cpp:(.text+0x4cd): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x52d): undefined reference to `vmime::exceptions::filesystem_exception::path() const'
    example6.cpp:(.text+0x5a7): undefined reference to `vmime::exception::other() const'
    example6.cpp:(.text+0x5bb): undefined reference to `vmime::exception::other() const'
    /tmp/cc1Z40dn.o: In function `printStructure(vmime::utility::ref<vmime::net::structure const>, int)':
    example6.cpp:(.text+0x697): undefined reference to `vmime::lineLengthLimits::infinite'
    example6.cpp:(.text+0x6cb): undefined reference to `vmime::component::generate(unsigned int, unsigned int) const'
    /tmp/cc1Z40dn.o: In function `getFolderPathString(vmime::utility::ref<vmime::net::folder>)':
    example6.cpp:(.text+0x84b): undefined reference to `vmime::word::getBuffer() const'
    /tmp/cc1Z40dn.o: In function `sendMessage()':
    example6.cpp:(.text+0xe51): undefined reference to `vmime::utility::url::url(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    example6.cpp:(.text+0xea0): undefined reference to `vmime::net::session::getTransport(vmime::utility::url const&, vmime::utility::ref<vmime::security::authenticator>)'
    example6.cpp:(.text+0xf56): undefined reference to `vmime::net::service::setCertificateVerifier(vmime::utility::ref<vmime::security::cert::certificateVerifier>)'
    example6.cpp:(.text+0xfbf): undefined reference to `vmime::mailbox::mailbox(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    example6.cpp:(.text+0xfcd): undefined reference to `vmime::mailboxList::mailboxList()'
    example6.cpp:(.text+0x1057): undefined reference to `vmime::mailboxList::appendMailbox(vmime::utility::ref<vmime::mailbox>)'
    example6.cpp:(.text+0x1169): undefined reference to `vmime::utility::inputStreamStringAdapter::inputStreamStringAdapter(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    /tmp/cc1Z40dn.o: In function `connectStore()':
    example6.cpp:(.text+0x158a): undefined reference to `vmime::utility::url::url(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
    example6.cpp:(.text+0x15a6): undefined reference to `vmime::utility::url::getUsername() const'
    example6.cpp:(.text+0x15c0): undefined reference to `vmime::utility::url::getPassword() const'

     
  • Mnouh
    Mnouh
    2011-04-29

    This is after I make install… what I get. I've followed the directions exactly as you provided in the documentation when it came to compiling and installing.

    make: Leaving directory `/home/rad/Desktop/libvmime-0.9.1/vmime'
    make: Leaving directory `/home/rad/Desktop/libvmime-0.9.1/vmime'
    make: Entering directory `/home/rad/Desktop/libvmime-0.9.1'
    make: Entering directory `/home/rad/Desktop/libvmime-0.9.1'
    make: Nothing to be done for `install-exec-am'.
    test -z "/usr/local/share/doc/vmime" || /bin/mkdir -p "/usr/local/share/doc/vmime"
    /usr/bin/install -c -m 644 AUTHORS ChangeLog COPYING INSTALL NEWS README '/usr/local/share/doc/vmime'
    test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
    /usr/bin/install -c -m 644 vmime.pc '/usr/local/lib/pkgconfig'
    make: Leaving directory `/home/rad/Desktop/libvmime-0.9.1'
    make: Leaving directory `/home/rad/Desktop/libvmime-0.9.1'

     
  • Mnouh
    Mnouh
    2011-04-29

    I'll also include these errors because they are kinda different: Obviously its some problem with the linking. It cant find it.

    /tmp/cc1Z40dn.o: In function `interactiveCertificateVerifier::~interactiveCertificateVerifier()':
    example6.cpp:(.text._ZN30interactiveCertificateVerifierD2Ev+0x16): undefined reference to `vmime::security::cert::defaultCertificateVerifier::~defaultCertificateVerifier()'
    /tmp/cc1Z40dn.o:(.rodata._ZTV24interactiveAuthenticator+0x18): undefined reference to `vmime::security::sasl::defaultSASLAuthenticator::getHostname() const'
    /tmp/cc1Z40dn.o:(.rodata._ZTV24interactiveAuthenticator+0x1c): undefined reference to `vmime::security::sasl::defaultSASLAuthenticator::getAnonymousToken() const'
    /tmp/cc1Z40dn.o:(.rodata._ZTV24interactiveAuthenticator+0x20): undefined reference to `vmime::security::sasl::defaultSASLAuthenticator::getServiceName() const'
    /tmp/cc1Z40dn.o:(.rodata._ZTV24interactiveAuthenticator+0x24): undefined reference to `vmime::security::sasl::defaultSASLAuthenticator::setService(vmime::utility::ref<vmime::net::service>)'
    /tmp/cc1Z40dn.o:(.rodata._ZTV24interactiveAuthenticator+0x2c): undefined reference to `vmime::security::sasl::defaultSASLAuthenticator::setSASLSession(vmime::utility::ref<vmime::security::sasl::SASLSession>)'
    /tmp/cc1Z40dn.o: In function `interactiveAuthenticator::~interactiveAuthenticator()':
    example6.cpp:(.text._ZN24interactiveAuthenticatorD2Ev+0x33): undefined reference to `vmime::security::sasl::defaultSASLAuthenticator::~defaultSASLAuthenticator()'
    example6.cpp:(.text._ZN24interactiveAuthenticatorD2Ev+0x6b): undefined reference to `vmime::security::sasl::defaultSASLAuthenticator::~defaultSASLAuthenticator()'
    /tmp/cc1Z40dn.o:(.rodata._ZTVN5vmime7utility11inputStreamE+0x10): undefined reference to `vmime::utility::stream::getBlockSize()'
    /tmp/cc1Z40dn.o:(.rodata._ZTVN5vmime7utility12outputStreamE+0x10): undefined reference to `vmime::utility::stream::getBlockSize()'
    /tmp/cc1Z40dn.o:(.rodata._ZTI30interactiveCertificateVerifier+0x8): undefined reference to `typeinfo for vmime::security::cert::defaultCertificateVerifier'
    /tmp/cc1Z40dn.o:(.rodata._ZTI24interactiveAuthenticator+0x8): undefined reference to `typeinfo for vmime::security::sasl::defaultSASLAuthenticator'
    /tmp/cc1Z40dn.o:(.rodata._ZTIN5vmime8security4cert11certificateE+0x8): undefined reference to `typeinfo for vmime::object'
    /tmp/cc1Z40dn.o:(.rodata._ZTIN5vmime16headerFieldValueE+0x8): undefined reference to `typeinfo for vmime::component'
    /tmp/cc1Z40dn.o:(.rodata._ZTIN5vmime7utility11inputStreamE+0x8): undefined reference to `typeinfo for vmime::utility::stream'
    /tmp/cc1Z40dn.o:(.rodata._ZTIN5vmime7utility12outputStreamE+0x8): undefined reference to `typeinfo for vmime::utility::stream'
    collect2: ld returned 1 exit status

     
  • Mnouh
    Mnouh
    2011-05-03

    when I ran configure it gave me:

    +=================+
    |  CONFIGURATION  |
    +=================+

    Installation prefix      : /usr/local
    Debugging mode           : no
    Messaging support        : yes
         * protocols         : pop3 smtp imap maildir sendmail
    File-system support      : yes
    Platform handlers        : posix
    SASL support             : yes
    TLS/SSL support          : yes

     
  • Mnouh
    Mnouh
    2011-05-05

    I installed a new flavor of linux to try it out again. (Debian)
    I'm still getting errors.
    TLS, SSL = yes on the config as well.

    rad@debianV:~/Desktop/libvmime-0.9.1/examples$ g++ -o example6 example6.cpp `pkg-config libvmime`
    /tmp/cc5xSfAc.o: In function `findAvailableProtocols(vmime::net::service::Type)':
    example6.cpp:(.text+0xf): undefined reference to `vmime::net::serviceFactory::getInstance()'
    example6.cpp:(.text+0x54): undefined reference to `vmime::net::serviceFactory::getServiceAt(int) const'
    example6.cpp:(.text+0xe1): undefined reference to `vmime::net::serviceFactory::getServiceCount() const'
    /tmp/cc5xSfAc.o: In function `operator<<(std::basic_ostream<char, std::char_traits<char> >&, vmime::exception const&)':
    example6.cpp:(.text+0x1ea): undefined reference to `typeinfo for vmime::exceptions::command_error'
    example6.cpp:(.text+0x1f2): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x215): undefined reference to `typeinfo for vmime::exceptions::command_error'
    example6.cpp:(.text+0x21d): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x23a): undefined reference to `vmime::exceptions::command_error::command() const'
    example6.cpp:(.text+0x276): undefined reference to `vmime::exceptions::command_error::response() const'
    example6.cpp:(.text+0x2c8): undefined reference to `typeinfo for vmime::exceptions::invalid_response'
    example6.cpp:(.text+0x2d0): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x2ef): undefined reference to `typeinfo for vmime::exceptions::invalid_response'
    example6.cpp:(.text+0x2f7): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x314): undefined reference to `vmime::exceptions::invalid_response::response() const'
    example6.cpp:(.text+0x366): undefined reference to `typeinfo for vmime::exceptions::connection_greeting_error'
    example6.cpp:(.text+0x36e): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x38d): undefined reference to `typeinfo for vmime::exceptions::connection_greeting_error'
    example6.cpp:(.text+0x395): undefined reference to `typeinfo for vmime::exception'
    example6.cpp:(.text+0x3b2): undefined reference to `vmime::exceptions::connection_greeting_error::response() const'
    example6.cpp:(.text+0x404): undefined reference to `typeinfo for vmime::exceptions::authentication_error'
    example6.cpp:(.text+0x40c): undefined reference to `typeinfo for vmime::exception'

     
  • Mnouh
    Mnouh
    2011-05-05

    Found the problem:
    g++ ‘pkg-config -cflags -libs vmime‘ -o myprog myprog.cpp when I copied it from the pdf

    its actually suppose to be:

    $ g++ `pkg-config -cflags -libs vmime` -o myprog myprog.cpp

    notice the `, dunno why it did that when I copied and pasted it.

     
  • Mnouh
    Mnouh
    2011-05-05

    Does vmime support generating .eml files for all the emails in a folder(inbox). Then saving them to my hd

     
  • Hello,

    Glad to see you finally managed to fix this compilation issue!

    As for EML files, they are simply text files containing a MIME representation of the message. So, you simply have to loop on all messages, call generate() on each vmime::message, then save the result to a file named with ".EML" extension.

    Regards,

    Vincent

     
  • Mnouh
    Mnouh
    2011-05-05

    okay thank you vincent, ill give it a try!
    I'm working in a linux environment, if I ever wanted to package my c++ project that uses your library, how would I do so for a windows environment. Would they have to install the vmime library or something?