On 8/21/07, Gavin Lambert <[EMAIL PROTECTED]> wrote:
> Quoth Bob Grimes:
> > I'm still hoping someone knows the magic I'm missing.  I can't believe
> > nobody uses C++ under uClinux!
>
> Well, I do, but I'm using a much older toolchain (I don't have ucfront, for
> example).  And I'm not using -msep-data or -move-rodata.  And I'm not using
> STLport :)

<Grain of salt ingested here>

> Bear in mind that there's a fairly hefty code size penalty in using C++ (at
> least with gcc), which is possibly why it's not all that common in embedded
> development.

So the reputation goes... It's not too much a concern (at least now!)
as I have plenty of memory, and little code outside of the OS...

> (One issue I came across is that any code in your constructors
> can be duplicated in the resulting image up to three times for no readily
> apparent reason.  So try to avoid large constructors!)

Point taken, and thanks for the heads up.

> You're not specifying any libraries in there.

Of course not - I don't know which to specify ;-)

> At minimum you'll probably need -lsupc++;

Yup!  That's the ONE!

> if you're using any STL then you'll need -lstdc++ as well. If you're doing 
> something
> esoteric you might need -lgcc too, though that's unusual.
>
> The library order I normally use is:
>   - custom libraries
>   - -lstdc++
>   - -lsupc++
>   - -lm (if needed)
>   - -lc (if needed)
>   - -lgcc (if needed)
>
> Don't know if that's "correct", but it seems to work ok for me.

Well, I don't know either, but all I did was add the -lsupc++, and it
links!  Won't have a chance to actually run it until tonight, but I'm
pretty sure it will, other than any of _my_ bugs!  Gavin, you rock!

Also, I'll possibly be using STL, so thanks also for the additional information.

Thanks Gavin!
-Bob
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to