0

I'd like to include two libraries: <allegro.h> and <windows.h> in my project, but I can't compile it. The IDE shows such errors:

error C2371: 'BITMAP' : redefinition; different basic types
error C2731: 'WinMain' : function cannot be overloaded
error C2733: second C linkage of overloaded function 'WinMain' not allowed

I understand both of the libraries have for example a structure called BITMAP so they're in a conflict. What should I do to compile my project with these libraries? I thought about namespaces but I couldn't use it successfully.

apxcode
  • 7,696
  • 7
  • 30
  • 41

2 Answers2

0

There is a special fix for that provided by allegro. Include "winalleg.h" (instead of "Windows.h") right after "allegro.h".

ooga
  • 15,423
  • 2
  • 20
  • 21
0

A quick web search suggested using #include <winalleg.h> instead of #include <windows.h>.

user3553031
  • 5,990
  • 1
  • 20
  • 40