Linked List class not working on OS5

Trying to use Sam Grove’s Linked List class that works on OS2, however it throws an error in OS5.

https://os.mbed.com/users/sam_grove/code/LinkedList/

> LinkedList<node>list;

Error: Use of undeclared identifier ‘node’ in “main.cpp”, Line: 4, Col: 12

Any suggestions ?

Hello Paul,
Unfortunately a class with the same name but different implementation has been defined in Mbed OS 5 ("/mbed-os/drivers/internal/LinkedList.h"). To use Sam Grove’s “LinkedList” library, once pasted into your project try to rename the class and the associated files to something else, for example “LinkedList_SG”. Also remember to modify the “main.cpp” accordingly.
As an alternative solution, you can try to use one of the containers available in the C++ Standard Template Library. For example “Deque” or “Vector”.
Best regards, Zoltan

Hi Zoltan,
Thank you, renaming anything with

LinkedList

to

LinkedList2

solved the issue. :slightly_smiling_face:

Using C++ namespaces should be also a clean solution.