Compiling and linking C++ programs

Jason Perry jperry at hanover-square.freeserve.co.uk
Sun Jun 16 11:48:53 PDT 2002


In message <670988474b.peter at moo.chocky.org> you wrote:

[more linking problems]
> No problem - there is work under way to improve documentation.
> Unfortunately, Paul has given time and again misleading and incorrect
> advice on this list despite requests for him not to.  Please double
> check anything he may have said to you.
Well it was basically download everything again, and reinstall from
scratch. So I assumed, that perhaps I had downloaded an early archive
that had missing files - which had since been replaced. So, it was
correct advice in the end...though the fault was mine!

Anyhow, now that I can compile and link simple C++ proggies, I've moved
onto something a bit more meaty. I've been asked to have a look at
seeing whether NQC: "http://www.enteract.com/~dbaum/nqc/index.html" can
be ported to RISC OS.

It's basically a compiler for the Lego Brick and someone else is writing
the tools to download the generated binary to the hardware.

Again, I got it to compile OK fairly easily (though it takes almost an
hour on my SA RiscPC!) but when it comes to linking I get loads of
missing symbols - here are a few:

Drlink AOF Linker  Version 0.37  07/02/98  [GCCSDK build]
Error: The following symbols could not be found:
    'terminate__Fv' referenced in '/home/riscos/gccsdk-2.95/arm-riscos-aof/
    gcc-2_95_4/libstdc/apcs26/unixlib/stdexcepti.o'
    '__eh_alloc' referenced in '/home/riscos/gccsdk-2.95/arm-riscos-aof/
    gcc-2_95_4/libstdc/apcs26/unixlib/stdexcepti.o'
    '__ti9exception' referenced in '/home/riscos/gccsdk-2.95/arm-riscos-aof/
    gcc-2_95_4/libstdc/apcs26/unixlib/stdexcepti.o'
    '__tf9exception' referenced in '/home/riscos/gccsdk-2.95/arm-riscos-aof/
    gcc-2_95_4/libstdc/apcs26/unixlib/stdexcepti.o'
    '_vt$9exception' referenced in '/home/riscos/gccsdk-2.95/arm-riscos-aof/
    gcc-2_95_4/libstdc/apcs26/unixlib/stdexcepti.o'
    '__cp_push_exception' referenced in '/home/riscos/gccsdk-2.95/
    arm-riscos-aof/gcc-2_95_4/libstdc/apcs26/unixlib/stdexcepti.o'
    'NewSerial__7PSerial' referenced in 'o.RCX_SerialPipe'
    '__rtti_si' referenced in 'o.RCX_PipeTransport'
    'GetDefaultName__7PSerial' referenced in 'o.RCX_link'
    'RCX_NewUSBTowerPipe__Fv' referenced in 'o.RCX_link'
    '__builtin_new' referenced in 'o.RCX_link'
    '__cp_pop_exception' referenced in 'o.RCX_Disasm'
    '__uncatch_exception' referenced in 'o.RCX_Disasm'
    '__ls__7ostreamPFR7ostream_R7ostream' referenced in 'o.RCX_Disasm'
    'endl__FR7ostream' referenced in 'o.RCX_Disasm'
    'cerr' referenced in 'o.RCX_Disasm'
    '__nw__FUiPv' referenced in 'o.RCX_Disasm'
    '__get_eh_context' referenced in 'o.RCX_Disasm'
    '___arm_alloca_setjmp' referenced in 'o.RCX_Disasm'
    '__pure_virtual' referenced in 'o.RCX_Disasm'
    '__check_eh_spec' referenced in 'o.RCX_Disasm'
    '__sjthrow' referenced in 'o.RCX_Disasm'
    '__start_cp_handler' referenced in 'o.RCX_Disasm'
    '__rtti_user' referenced in 'o.RCX_Disasm'
    '__terminate' referenced in 'o.RCX_Disasm'
    '__ls__7ostreamPCc' referenced in 'o.RCX_Disasm'
    '__builtin_vec_new' referenced in 'o.RCX_Cmd'
    '__builtin_vec_delete' referenced in 'o.RCX_Cmd'
    '__builtin_delete' referenced in 'o.RCX_Cmd'
Drlink: Link failed with 1 error

I'm linking in 'libstdc++' and 'unixlib', but I can't seem to figure out
where the other symbols should come from. I've tried 'libiostream', but
comparing the Unix makefile only shows that it links in 'libstdc++'.

I've come across problems with drlink fairly recently, with regard to C
linking, but problem was quite different. Before, I point my finger
anywhere in particular, can anybody see anything I'm doing obviously
wrong?

Thanks in advance,

-- 
Jason Perry



More information about the gcc mailing list