Re: [AD] Conflict between Allegro and std string library

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Thomas Fjellstrom wrote:

On May 28, 2004 11:55 am, Maestro wrote:
Hi

There is a conflict between Allegro (4.0) and "string" library.
I tried to compile the following code under Dev-C++ 4.9.8.9:

For some reason the mingw stl headers include the windows.h header... adding -D__GTHREAD_HIDE_WIN32API to your compile step may help.

Although I know this is a fairly common fix, I dont know why its needed. Ive used mingw in windows 2k and xp and never had to use -D__GTHREAD_HIDE_WIN32API.

Anyway, your code would still have errors becuase you cant use string as a char* that textout needs. To get around this, use the c_str() function of string:

textout(screen, font, String.c_str(),
       (SCREEN_W - text_length(font, String.c_str())) >> 1,
        text_height(font) + 2, 14);

Sorry for the wide distrubution if this has been settled already.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/