linking to string error

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
amjad88
Posts: 4
Joined: Thu Jun 11, 2009 4:49 am

linking to string error

Post by amjad88 »

hi to all i am new to os dev but not to c++ i am having a problem in the kernel when i use #include<string> i get


kernel.o(.text+0x51):kernel.cpp: undefined reference to `__ZNSsC1Ev'
kernel.o(.text+0xe1):kernel.cpp: undefined reference to `__ZNSsD1Ev'


can any one help plz thx
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: linking to string error

Post by JamesM »

You can't include <string> as you don't have a standard library.
amjad88
Posts: 4
Joined: Thu Jun 11, 2009 4:49 am

Re: linking to string error

Post by amjad88 »

ok what can i do to fix this error
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: linking to string error

Post by JamesM »

amjad88 wrote:ok what can i do to fix this error
Don't #include <string> !

You can't use any standard library function in a kernel.

You could also use capital letters and punctuation, and lose the text-speak. That could help too.
amjad88
Posts: 4
Joined: Thu Jun 11, 2009 4:49 am

Re: linking to string error

Post by amjad88 »

soo what is the soution how to use string ??
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: linking to string error

Post by JamesM »

JamesM wrote: You can't use any standard library function in a kernel.
You can't use string. Full stop. You have to write your own string handling functions.
amjad88
Posts: 4
Joined: Thu Jun 11, 2009 4:49 am

Re: linking to string error

Post by amjad88 »

can i plz have your email thx
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: linking to string error

Post by JamesM »

No, and as a special favour I'm going to lock this thread and give you an official warning.

thx

EDIT: I have now permbanned him for abusing me via PM.
Locked