Re: unresolved symbols with 2.0.34

Vladimir Dergachev (vladimid@seas.upenn.edu)
Thu, 20 Aug 1998 11:07:46 -0400 (EDT)


>
> Alan Cox wrote:
> >
> > > Now I started to implement the same with C++ wrote some classes which
> > > calls the same functions and got the following:
> >
> > C++ does name mangling. Thats going to make life entertaining. The
> > pcibios_* functions appear to be mangled which suggests they aren't
> > extern "C" ..
>
> Is it possible to make them extern "C" by rebuilding the kernel and the
> libs?
>
you can just declare them in your model like this :
extern "C" {
..pcibios....
}

> >
> > > kip5.o: unresolved symbol __builtin_delete
> > > kip5.o: unresolved symbol __builtin_new
> >
> > And these two are C++ library internal functions not present in the
> > kernel
> OK these one can replaced with kmalloc(..) & kfree(..).
> >
> > > Is this a problem of the g++ ore the linker?
> >
> > I think the problem is your driver on the whole, coupled with the fact
> > you are hitting C++/C linking stuff
>
> So do you think there is no way to write driver in C++?
>

Why would you want to write driver in C++ ??
There are two ways :
write in C and make a C++ wrapper for ioctl's (you can use them to pass
data btw your model and your library/program)

If you want OOP just do it in C. Good part of the kernel is done in OOP..
(look at all the structures with function pointers) and when you write
something low level you would like to have control over how your objects
are stored..

Vladimir Dergachev

> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html