[Click] STL sort and kernel-level Click

Daniel Pall dpall at princeton.edu
Mon Dec 3 01:12:09 EST 2007


Hello folks,

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.


So if anyone has any ideas, or could point me to the right answer, I'd
really appreciate it.  Thanks!
Dan


More information about the click mailing list