STL usage in UMDF driver

Hi,

i have an issue i was trying to use STL in UMDF driver. The first step towards this was to use the USE_STL = 1 macro is my sources file.

After including this now its able to detect list in # include . With out this macro it was giving the following error

error C1083: Cannot open include file: ‘list’: No such file or directory

So after using the USE_STL macro this error got resolved…

Now when i am using typedef list < _mystruct*> _List_struct; i am facing this error

error C2143: syntax error : missing ‘;’ before ‘<’

Which means it is unable to recognize the list template…

So can any one suggest me whether it is possible to USe the STL like list, map and hash map in a UMDF driver…

Apart from inclusing the above mentioned macro do i need to provide anything else

Thanks,
chaitu

> -----Original Message-----

From: xxxxx@lists.osr.com [mailto:bounce-473789-
xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, September 08, 2011 7:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] STL usage in UMDF driver

Hi,

i have an issue i was trying to use STL in UMDF driver. The first step
towards this was to use the USE_STL = 1 macro is my sources file.

After including this now its able to detect list in # include .
With
> out this macro it was giving the following error
>
> error C1083: Cannot open include file: ‘list’: No such file or directory
>
> So after using the USE_STL macro this error got resolved…
>
> Now when i am using typedef list < _mystruct*> _List_struct; i am facing
this
> error

How about:
typedef std::list < _mystruct*> _List_struct;

Alternatively, you could insert:
using namespace std;
before the first reference to a type defined in that namespace, but that
means that you have just made the entire std namespace visible, whether you
wanted to or not.

> error C2143: syntax error : missing ‘;’ before ‘<’
>
> Which means it is unable to recognize the list template…
>
> So can any one suggest me whether it is possible to USe the STL like list,
map
> and hash map in a UMDF driver…

If you can include the header, it should work. Can’t say that about
kernel drivers, but it should be OK in UMDF.

Phil

Philip D. Barila

One fix would be to use the std:: prefix as follows:

typedef std::list < _mystruct*> _List_struct;

another solution would be to add the following statement prior:

using std::list;

Hi,

Got the error fixed, by using name space std, it was mistake on my part…

thanks to all for pointing it out

But now i am facing the same issue when trying to use push_back call from the list
using namespace std:

typedef list < _mystruct*> _List_struct;

_List_struct.push_back(local_mystruct);

error is error C2143: syntax error : missing ‘;’ before ‘.’

So Push_back is not getting recognized.

I checked by using global std namespace and using different stl versions…but was not successful…the same code with in the application is working very much fine…

But when i start Using the same with in the UMDF driver it is giving the error…

Thanks to all
Krishna

You need to call the method on an instance of the type. The type(def) itself is not an instantiation of the type

d

debt from my phone

-----Original Message-----
From: xxxxx@gmail.com
Sent: Monday, September 12, 2011 5:47 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] STL usage in UMDF driver

Hi,

Got the error fixed, by using name space std, it was mistake on my part…

thanks to all for pointing it out

But now i am facing the same issue when trying to use push_back call from the list
using namespace std:

typedef list < _mystruct*> _List_struct;

_List_struct.push_back(local_mystruct);

error is error C2143: syntax error : missing ‘;’ before ‘.’

So Push_back is not getting recognized.

I checked by using global std namespace and using different stl versions…but was not successful…the same code with in the application is working very much fine…

But when i start Using the same with in the UMDF driver it is giving the error…

Thanks to all
Krishna


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi,

got it working it was a issue in the typedef.

Thanks a lot…

Thanks doron for poinitng out, i didn’t see ur post when i made my earlier post…