×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    36

    GCCE Undefined reference

    Hi,

    I am tryn to create a dll from a c++ code to use it on symbianC++ using openC.

    When I compile using WINSCW the compilation is successful and the application runs porperly. But when I comile on GCCE I got the following:

    Code:
    ***Invoking abld command
    perl.exe -S ABLD.PL \CarbideWS\OSCpack\group\ target gcce urel  
      make -r  -f "\S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\GCCE.make" TARGET CFG=UREL VERBOSE=-s
    make -j 4 -s  -r -f "\S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\OSCPACK.GCCE" UREL
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::OutboundPacketStream::CheckForAvailableBundleSpace()':
    oscoutboundpacketstream.cpp:(.text+0x11c): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::OutboundPacketStream::CheckForAvailableMessageSpace(char const*)':
    oscoutboundpacketstream.cpp:(.text+0x1a8): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::OutboundPacketStream::CheckForAvailableArgumentSpace(long)':
    oscoutboundpacketstream.cpp:(.text+0x21a): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::OutboundPacketStream::operator<<(osc::BundleInitiator const&)':
    oscoutboundpacketstream.cpp:(.text+0x2f2): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::OutboundPacketStream::operator<<(osc::BundleTerminator const&)':
    oscoutboundpacketstream.cpp:(.text+0x38a): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o:oscoutboundpacketstream.cpp:(.text+0x3b6): more undefined references to `std::exception::exception()' follow
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::OutOfBufferMemoryException::~OutOfBufferMemoryException()':
    oscoutboundpacketstream.cpp:(.text._ZN3osc26OutOfBufferMemoryExceptionD1Ev[_ZN3osc26OutOfBufferMemoryExceptionD1Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::MessageInProgressException::~MessageInProgressException()':
    oscoutboundpacketstream.cpp:(.text._ZN3osc26MessageInProgressExceptionD1Ev[_ZN3osc26MessageInProgressExceptionD1Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::BundleNotInProgressException::~BundleNotInProgressException()':
    oscoutboundpacketstream.cpp:(.text._ZN3osc28BundleNotInProgressExceptionD1Ev[_ZN3osc28BundleNotInProgressExceptionD1Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::MessageNotInProgressException::~MessageNotInProgressException()':
    oscoutboundpacketstream.cpp:(.text._ZN3osc29MessageNotInProgressExceptionD1Ev[_ZN3osc29MessageNotInProgressExceptionD1Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o: In function `osc::Exception::~Exception()':
    oscoutboundpacketstream.cpp:(.text._ZN3osc9ExceptionD0Ev[_ZN3osc9ExceptionD0Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o:oscoutboundpacketstream.cpp:(.text._ZN3osc9ExceptionD1Ev[_ZN3osc9ExceptionD1Ev]+0x8): more undefined references to `std::exception::~exception()' follow
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscOutboundPacketStream.o:(.rodata._ZTIN3osc9ExceptionE[_ZTIN3osc9ExceptionE]+0x8): undefined reference to `typeinfo for std::exception'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::ReceivedMessageArgument::AsBool() const':
    oscreceivedelements.cpp:(.text+0x16c): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0x18a): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::ReceivedMessageArgument::AsBoolUnchecked() const':
    oscreceivedelements.cpp:(.text+0x204): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::ReceivedMessageArgument::AsInt32() const':
    oscreceivedelements.cpp:(.text+0x25e): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0x284): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o:oscreceivedelements.cpp:(.text+0x32e): more undefined references to `std::exception::exception()' follow
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::ReceivedMessage::Init(char const*, unsigned long)':
    oscreceivedelements.cpp:(.text+0xdb6): undefined reference to `std::exception::~exception()'
    oscreceivedelements.cpp:(.text+0xdd0): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xdec): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xe08): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xe2e): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xebe): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xed2): undefined reference to `std::exception::~exception()'
    oscreceivedelements.cpp:(.text+0xef4): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xf16): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xf32): undefined reference to `std::exception::exception()'
    oscreceivedelements.cpp:(.text+0xf8e): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::ReceivedBundle::Init(char const*, unsigned long)':
    oscreceivedelements.cpp:(.text+0x1060): undefined reference to `std::exception::exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o:oscreceivedelements.cpp:(.text+0x107e): more undefined references to `std::exception::exception()' follow
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::WrongArgumentTypeException::~WrongArgumentTypeException()':
    oscreceivedelements.cpp:(.text._ZN3osc26WrongArgumentTypeExceptionD1Ev[_ZN3osc26WrongArgumentTypeExceptionD1Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::MissingArgumentException::~MissingArgumentException()':
    oscreceivedelements.cpp:(.text._ZN3osc24MissingArgumentExceptionD1Ev[_ZN3osc24MissingArgumentExceptionD1Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OscReceivedElements.o: In function `osc::MalformedMessageException::~MalformedMessageException()':
    oscreceivedelements.cpp:(.text._ZN3osc25MalformedMessageExceptionD1Ev[_ZN3osc25MalformedMessageExceptionD1Ev]+0x8): undefined reference to `std::exception::~exception()'
    \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel
    . . .
    . . .(Forum error: The text that you have entered is too long)
    . . .
    \S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\ARMV5\urel\libcrt0.lib(mcrt0.o): In function `CallMain(int, char**, char**)':
    \wk29\stdlibs\backend\src\ucrt\mcrt0.cpp:(.emb_text+0x0): undefined reference to `main'
    arm-none-symbianelf-ld: \S60\devices\S60_5th_Edition_SDK_v1.0\EPOC32\BUILD\CarbideWS\OSCpack\group\OSCPACK\GCCE\urel\OSCpack.dll: hidden symbol `main' isn't defined
    arm-none-symbianelf-ld: final link failed: Nonrepresentable section on output
    make[1]: *** [\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\release\gcce\urel\OSCpack.dll] Error 1
    make: *** [TARGETOSCPACK] Error 2
    Code:
    STATICLIBRARY   libcrt0.lib
    LIBRARY         libc.lib 
    LIBRARY         euser.lib 
    LIBRARY		libglib.lib

  2. #2
    Registered User
    Join Date
    Jun 2009
    Posts
    36

    Re: GCCE Undefined reference

    Here is the problematic class:

    Code:
    #ifndef INCLUDED_OSC_EXCEPTION_H
    #define INCLUDED_OSC_EXCEPTION_H
    
    #include <exception>
    
    namespace osc{
    
    class Exception : public std::exception {
        const char *what_;
        
    public:
        Exception() throw() {}
        Exception( const Exception& src ) throw()
            : what_( src.what_ ) {}
        Exception( const char *w ) throw()
            : what_( w ) {}
        Exception& operator=( const Exception& src ) throw()
            { what_ = src.what_; return *this; }
        virtual ~Exception() throw() {}
        virtual const char* what() const throw() { return what_; }
    };
    
    } // namespace osc
    
    #endif /* INCLUDED_OSC_EXCEPTION_H */
    Any suggestion?

    Thanks.

  3. #3
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: GCCE Undefined reference

    hello,


    at first, for openc, you need something like

    Code:
    #ifdef GCCE
    STATICLIBRARY      libcrt0_gcce.lib
    #else
    STATICLIBRARY      libcrt0.lib
    #endif

    and second, for openc++ you need to link libstdcpp:

    Code:
    #ifdef EPOC32
    LIBRARY  libstdcpp.lib
    #else
    FIRSTLIB ../udeb/libstdcpp.lib
    STATICLIBRARY    eexe.lib 
    #endif

    regards,

    Pai
    Symbian && Android && iPhoneOS

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    36

    Re: GCCE Undefined reference

    Perfect!

    Thanks.

  5. #5
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: GCCE Undefined reference

    Hi

    I have same problem see following code and I add following code in .mmp file also but same error.

    #ifdef EPOC32
    LIBRARY libstdcpp.lib
    #else
    FIRSTLIB ../udeb/libstdcpp.lib
    STATICLIBRARY eexe.lib
    #endif

    Error Code
    -----------
    Code:
    videoencoder.cpp(.text+0x128)- undefined reference to `avcodec_find_encoder(CodecID)'
    videoencoder.cpp(.text+0x140)- undefined reference to `avcodec_alloc_context()'
    videoencoder.cpp(.text+0x148)- undefined reference to `avcodec_alloc_frame()'
    videoencoder.cpp(.text+0x1e0)- undefined reference to `avcodec_open(AVCodecContext*, AVCodec*)'
    videoencoder.cpp(.text+0x25c)- undefined reference to `avcodec_encode_video(AVCodecContext*, unsigned char*, int, AVFrame const*)'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Code\CODEC\OPEN_C\movino\movino-symbian\trunk\group\MOVINO\GCCE\UREL\videoencoder.- In function `CVideoEncoder :: ~CVideoEncoder()'-
    videoencoder.cpp(.text+0x2c0)- undefined reference to `av_free(void*)'
    videoencoder.cpp(.text+0x2d8)- undefined reference to `avcodec_close(AVCodecContext*)'
    videoencoder.cpp(.text+0x2e8)- undefined reference to `av_free(void*)'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Code\CODEC\OPEN_C\movino\movino-symbian\trunk\group\MOVINO\GCCE\UREL\videoencoder.o: In function `CVideoEncoder::~CVideoEncoder()'-
    videoencoder.cpp(.text+0x36c)- undefined reference to `av_free(void*)'
    videoencoder.cpp(.text+0x384)- undefined reference to `avcodec_close(AVCodecContext*)'
    videoencoder.cpp(.text+0x394)- undefined reference to `av_free(void*)'
    videoencoder.cpp(.text+0x418)- undefined reference to `av_free(void*)'
    videoencoder.cpp(.text+0x438)- undefined reference to `avcodec_close(AVCodecContext*)'
    videoencoder.cpp(.text+0x448)- undefined reference to `av_free(void*)'
    videoencoder.cpp(.text+0x56c)- undefined reference to `avcodec_encode_video(AVCodecContext*, unsigned char*, int, AVFrame const*)'
    videoencoder.cpp(.text+0x5dc)- undefined reference to `av_log_set_level(int)'
    videoencoder.cpp(.text+0x5e4)- undefined reference to `avcodec_init()'


    Library in .MMP File
    ---------------------

    LIBRARY euser.lib
    LIBRARY apparc.lib
    LIBRARY cone.lib
    LIBRARY eikcore.lib
    LIBRARY avkon.lib
    LIBRARY commonengine.lib
    LIBRARY ecam.lib
    LIBRARY eikcoctl.lib
    LIBRARY fbscli.lib
    LIBRARY efsrv.lib
    LIBRARY esock.lib
    LIBRARY bluetooth.lib
    LIBRARY btextnotifiers.lib
    LIBRARY sdpagent.lib
    LIBRARY sdpdatabase.lib
    LIBRARY btmanclient.lib
    LIBRARY flogger.lib
    LIBRARY mediaclientaudioinputstream.lib
    LIBRARY insock.lib
    LIBRARY inetprotutil.lib
    LIBRARY estlib.lib
    LIBRARY platformenv.lib
    LIBRARY bafl.lib
    LIBRARY hal.lib
    LIBRARY estor.lib
    LIBRARY charconv.lib
    LIBRARY ws32.lib
    LIBRARY eikdlg.lib
    LIBRARY commdb.lib
    LIBRARY gdi.lib
    LIBRARY lbs.lib
    LIBRARY libc.lib

    #ifdef EPOC32
    LIBRARY libstdcpp.lib
    #else
    FIRSTLIB ../udeb/libstdcpp.lib
    STATICLIBRARY eexe.lib
    #endif

    STATICLIBRARY libavcodec.lib libavutil.lib lbsproxy.lib libavcodecpart2.lib
    STATICLIBRARY libjpeg.lib libtheora.lib libogg.lib

    #ifndef NO_FFMPEG
    #if defined(EKA2) && !defined(WINSCW)
    //LIBRARY libgcc.lib
    #endif
    #endif

    Regards
    SymbianTH

Similar Threads

  1. [moved] HELP! Phone Debug (GCCE)
    By joseph.m in forum Symbian
    Replies: 18
    Last Post: 2008-07-14, 10:42
  2. carbide c++ can't find headers.!!
    By nokia_maniac in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 29
    Last Post: 2007-12-19, 12:54
  3. CameraApp Example 3rd Edition
    By bigbadwolf in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2007-05-28, 19:13
  4. file not found
    By praktikant in forum Symbian
    Replies: 16
    Last Post: 2007-05-09, 15:04
  5. 3rd edition: undefined reference
    By iulian_moldovan in forum Symbian
    Replies: 2
    Last Post: 2006-06-20, 14:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×