Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: Problems with constructor of static member class

2005-06-29 by Jaromir

Check also linker script. Are you sure that Keil support C++ ? I use GCC...

Jaromir

  > First :
  > instead static member , better is use singleton that call function
  with static object of your class.
  > Second:
  > standard startup.s file ( example from freertos or ... ) is only for 
  > C, so you nedd add extra code to call all constructors for global 
  > (static) obiects. Check WinARM site for example.


  I have found and added the following code: 

              LDR       r0, =__ctors_start__
              LDR       r1, =__ctors_end__
  ctor_loop:
              CMP       r0, r1
              BEQ       ctor_end
              LDR       r2, [r0], #4
              STMFD       sp!, {r0-r1}
              MOV       lr, pc
              MOV       pc, r2
              LDMFD       sp!, {r0-r1}
              B             ctor_loop
  ctor_end:

  But it doesn't do the trick yet. Is there something else I'm missing
  out? I'm using the startup.s file from Keil, which is intended to be
  used in C.

  /Søren


_________________________________________________________________
List sprawdzony skanerem poczty mks_vir ( http://www.mks.com.pl )


[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.