[AD] Conflict between Allegro and std string library |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
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:
===========================================
#include <string>
#include <allegro.h>
int main()
{
allegro_init();
set_gfx_mode(GFX_AUTODETECT, 1024, 768, 0, 0);
install_keyboard();
std::string String = "Press ESC to exit.";
textout(screen, font, String,
(SCREEN_W - text_length(font, String)) >> 1,
text_height(font) + 2, 14);
while(! key[KEY_ESC])
poll_keyboard();
allegro_exit();
return 0;
}
END_OF_MAIN();
=========================================
Many errors occured - some of them:
29 E:\Dev-Cpp\include\allegro\system.h
conflicting types for `struct BITMAP'
1181 E:\Dev-Cpp\include\wingdi.h
previous declaration as `typedef struct tagBITMAP BITMAP'
108 E:\Dev-Cpp\include\allegro\system.h
using typedef-name `BITMAP' after `struct'
(.......)
60 E:\Dev-Cpp\include\allegro\mouse.h
using typedef-name `BITMAP' after `struct'
57 E:\Dev-Cpp\include\allegro\gfx.h
using typedef-name `BITMAP' after `struct'
62 E:\Dev-Cpp\include\allegro\inline\rle.inl
cannot convert `BITMAP*' to `tagBITMAP*' in argument passing
(.....)
13 C:\TEst\main.cpp
cannot convert `std::string' to `const char*' for argument `2' to `int
14 C:\TEst\main.cpp
cannot convert `std::string' to `const char*' for argument `3' to `void
../../../../../TEst/main.cpp C:\TEst\main.cpp
At global scope:
22 C:\TEst\main.cpp
declaration of C function `int WinMain(void*, void*, char*, int)' conflicts
with
933 E:\Dev-Cpp\include\winbase.h
previous declaration `int WinMain(HINSTAN C:\Documents and
Settings\Maestro\Moje dokumenty\Opróżnij ten folder\template
Allegro\Makefile.win
[Build Error] [../../../../../TEst/main.o] Error 1CE__*, HINSTANCE__*,
CHAR*, int)' here
The end.
FL.