The compiler error you get is due to the void return value of the method. You simply call that method and the line is drawn. No scene node that is generated. The line is simply drawn to the buffer and will be removed in the next drawing cycle. That's why you either have to call it from the main render loop or from within a scene node's render method.
You have to create a custom scene node, i.e. create a CLineSceneNode.h and .cpp which implements the necessary methods. In render() you call the draw3dLine(). Then you can use the scene node methods.