Menu

Errors when compiling with g++ 4.6

Stuart A.
2013-10-04
2013-10-04
  • Stuart A.

    Stuart A. - 2013-10-04

    I've encountered an error compiling STAF on Ubuntu 12.04 which comes with g++ version 4.6.3. When trying to compile STAF from source I got huge numbers of linker errors, along the lines of:

    STAFSemService.cpp:(.text+0xf904): undefined reference to STAFEventSem::post()' STAFSemService.cpp:(.text+0xf91f): undefined reference toSTAFString::STAFString(char const*, unsigned int, STAFString::CodePageType)'
    STAFSemService.cpp:(.text+0xf934): undefined reference to STAFCommandParseResult::optionTimes(STAFString const&)' STAFSemService.cpp:(.text+0xf943): undefined reference toSTAFString::~STAFString()'
    STAFSemService.cpp:(.text+0xf9d2): undefined reference to STAFMutexSem::release()' STAFSemService.cpp:(.text+0xf9e8): undefined reference toSTAFThreadSafeDecrement'

    The strange thing was that my cross-compilers didn't exhibit the error, only my native compiler. I discovered that my cross compilers were based on g++ 4.4, and when I reverted to the most recent g++ 4.4 build in the Ubuntu repository (as of writing, 4.4.7) the linker errors vanished.

    I'm not certain what causes this issue, but I figgured you should be made aware that it's happening. This will hopefully also help others work out what's wrong with their STAF compilation in future.

    Cheers,
    Stuart

    STAFSemService.cpp:(.text+0xfb0b): undefined reference to `STAFString::~STAFString()'

     
  • Sharon Lucas

    Sharon Lucas - 2013-10-04

    Thanks for reporting this. Some of the STAF code was written a long time ago and may need to be updated to avoid this error using the latest g++ version. I'll look into this.

     

Log in to post a comment.