Page 1 of 2

linked list

Posted: Wed Oct 15, 2008 4:08 pm
by Johan
hi . im working on a world editor ,want to keep all my objects in multiple lists. irrlicht has a double link list class ,what i want to know is how to use it ,to be more specific i dnt know how to create it .

Posted: Wed Oct 15, 2008 4:29 pm
by JP
Then look at the API/docs.... It shows you how to use it...

Posted: Wed Oct 15, 2008 5:31 pm
by jddevnet
I can second that. The API documentation rocks!

http://irrlicht.sourceforge.net/docu/index.html

Re: linked list

Posted: Wed Oct 15, 2008 5:42 pm
by rogerborg
Johan wrote:to be more specific i dnt know how to create it .
Can you be a bit more specific? Are you having problems with the basic issue of templated classes, or with the specific usage of irr::core::list?

Posted: Wed Oct 15, 2008 5:45 pm
by Johan
i would not ask if i knew the answer or had the information at hand .never mind il use my own linked list and drop the engines class. problem is not using it but creating it ,template arguments etc...

Posted: Wed Oct 15, 2008 5:48 pm
by Johan
rogerborg ,yes exactly my problem i dnt know how to create it as a new list with the constructor

Posted: Wed Oct 15, 2008 9:58 pm
by Dark_Kilauea
Like almost all other templated container classes (like STL)....

Code: Select all

//For a list of ints
irr::core::list<int> mylist;

//For a list of floats
irr::core::list<float> mylist;

//For a list of some random class
irr::core::list<MyRandomClass> mylist;

//Hey, you can even do pointers
irr::core::list<MyRandomClass*> mylist;
All templated classes work like this. They may require additional template parameters, but this gives you the jist.

From then on, use them like any other normal class.

Code: Select all

mylist.doSomething();

Posted: Thu Oct 16, 2008 7:15 am
by Johan
thank you now i know there must be something wrong somewhere else becouse thats the way i did it ,i even tried the type f32 but i keep getting a error message -internal compiler error .

Posted: Thu Oct 16, 2008 10:00 am
by rogerborg
How about you open your kimono and show us your dangling pointers?

Posted: Thu Oct 16, 2008 10:28 am
by Johan
rogerborg ,even when i try the exact code example he gave me i get that error so its not specific to my own code ,problem with compiler settings? i read something that the problem could come from optimization options .. il look into it sometime but for now im sorted out ,just using my own linked list class .thanx for your support

Posted: Thu Oct 16, 2008 12:49 pm
by rogerborg
OK, but you'll still have a compiler problem waiting to bite you. Your DE, your rules though.

Posted: Thu Oct 16, 2008 1:23 pm
by Johan
hate those with teeth just sitting and waiting in ambush to bite me in the ass .. anyway would love to sort it out ,thanx though for everyones input

Posted: Thu Oct 16, 2008 9:28 pm
by Dark_Kilauea
error message -internal compiler error .
Without knowing the exact error, I will never be able to help you more. I'll also need to know what compiler/IDE you are using. If I remember right, msvc 2003 didn't support templates at all.

Posted: Thu Oct 16, 2008 11:52 pm
by vitek
Dark_Kilauea wrote:If I remember right, msvc 2003 didn't support templates at all.
You have a poor memory. :)

Posted: Fri Oct 17, 2008 7:56 am
by Johan
i would realy love to know exactly what the error is but supposedly the compiler gives you internal compiler error before it can evaluate what causes it so your left with just that message .i use msvc 6 on windows xp pro ,do u think that there might be diffrent compile settings on msvc 6? i did read about the error message and what could cause it ,basicly could have multiple causes ,but what i dnt get is that all other templated classes work .just as soon as i try creating the list class do i get that error.