[Click] STL sort and kernel-level Click

Bart Braem bart.braem at ua.ac.be
Mon Dec 3 04:44:20 EST 2007


On Monday 03 December 2007 07:12:09 Daniel Pall wrote:
> Fairly new Click user here.  I'm trying to compile the Linux module with
> kernel 2.6.19.2, with an additional user-defined element (called
> SeizeSwitch) included in it.  I'm running into a problem: I want to use the
> STL sort( ) function within SeizeSwitch, but when I try to #include
> <algorithm> at the top of my code, the compilation explodes at me - dozens
> of errors and conflicts with various Linux header files, etc.  My guess is
> that there is some sort of incompatibility with the Linux kernel module and
> the STL, because the same code (including algorithm header and the sort( )
> function) did successfully compile into a userlevel Click module.
>
> A smaller problem was that I also wanted to use the atoi( ) function
> defined in stdlib.h, and I tried to #include this, and it similarly
> exploded at me. Perhaps a similar incompatibility exists for stdlib.h? This
> isn't as big of a deal, though, since I can just write my own atoi( )
> function in a pinch and just put the code into my .cc file.  But sort( )
> isn't quite as simple.

The short answer: you can't use STL in the kernel...

Bart
-- 
Bart Braem
PATS research group
Dept. of Mathematics and Computer Sciences
University of Antwerp
Campus Middelheim, G3.30
Middelheimlaan 1
B-2020 Antwerpen, Belgium
Phone: +32 (0)3 265.32.91
Fax: +32 (0)3 265.37.77
Web: www.pats.ua.ac.be/bart.braem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part.
Url : https://pdos.csail.mit.edu/pipermail/click/attachments/20071203/aff52534/attachment.pgp


More information about the click mailing list