|
This thread is locked; no one can reply to it. |
1
2
|
Compile Errors |
Rick
Member #3,572
June 2003
|
I'm trying to take a project from Dev-C++ to MSVC++ 6.0, and where it compiles fine in Dev I get: c:\program files\microsoft visual studio\vc98\include\wingdi.h(486) : error C2371: 'BITMAP' : redefinition; different basic types c:\program files\microsoft visual studio\vc98\include\allegro\gfx.h(220) : see declaration of 'BITMAP' c:\program files\microsoft visual studio\vc98\include\wingdi.h(3429) : error C2229: struct 'tagDIBSECTION' has an illegal zero-sized array errors with MSVC. Anyone know what is going on? ======================================================== |
Ultio
Member #1,336
April 2001
|
What kind of project did you create when you started the MSVC project? It should be a "Win32" application and not "Win32 Console Application", or something else. That's the only thing I can think of that might be pulling wingdi.h into your project for no good reason. --- |
ReyBrujo
Moderator
January 2001
|
Include winalleg.h after allegro.h. -- |
Rick
Member #3,572
June 2003
|
I created 2 projects cause I thought that was it, but I get the same for both. Once in a project where do you check/change that? Quote: Include winalleg.h after allegro.h. I don't include winalleg at all. ======================================================== |
Ultio
Member #1,336
April 2001
|
I have no idea. I haven't used MSVC 6.0 in a long time. I'd say start over and use RB's advice. I'm assuming you're trying to use some Windows specific stuff in conjunction with Allegro, no? --- |
Rick
Member #3,572
June 2003
|
Quote: I'm assuming you're trying to use some Windows specific stuff in conjunction with Allegro, no? Nope ======================================================== |
Ultio
Member #1,336
April 2001
|
Hmm. When you choose to make a new "Win32" project, are you ensuring the the project is "empty" when it's created? I think there's a checkbox to create empty projects. This is more important in MSVC7, but I might also be required in MSVC6. --- |
ReyBrujo
Moderator
January 2001
|
Hmm.. you created an empty project, or created one that includes a stdafx.h file? If so, begin again and create an empty one. -- |
Rick
Member #3,572
June 2003
|
Same error. Here is what I do: 1) Create empty Win32 Application, call stacked ======================================================== |
Ultio
Member #1,336
April 2001
|
Are you sure you're not including some file that DevCPP created in order to work correctly? I don't know much about DevCPP and what it requires to work right. I'm guessing that it wouldn't make any weirdo files that are going to include Windows specific stuff (when dealing with Allegro programs), but you never know. Have you tried making a new project that has the barebones for ensuring that Allegro works in your MSVC studio? --- |
Wetimer
Member #1,622
November 2001
|
It looks as if you are somehow including the windows header. Probably in MSVC some of the standard headers do that. Whatever file is giving you errors, put this at the top. #include <allegro.h> #include <winalleg.h> That magic should fix the errors. <code>if(Windows.State = Crash) Computer.halt();</code> |
Kitty Cat
Member #2,815
October 2002
|
You're including something that includes windows.h. You need to include allegro and winalleg.h before whatever it is. -- |
Rick
Member #3,572
June 2003
|
Quote: Have you tried making a new project that has the barebones for ensuring that Allegro works in your MSVC studio? A small allegro app works. I've never had this problem before. I'll try your fix Ewert but I still don't understand why it's doing this, when it works normally. Quote: You're including something that includes windows.h. I'm not doing anything out of the normal. Like I said it compiles with Dev ======================================================== |
Kitty Cat
Member #2,815
October 2002
|
Quote: I'm not doing anything out of the normal. Like I said it compiles with Dev Doesn't mean much. MSVC is probably trying to pull in a Windows header from a "standard" header, which pulls in windows.h. -- |
Rick
Member #3,572
June 2003
|
Ah it's probably tinyXML doing it. ======================================================== |
Dennis
Member #1,090
July 2003
|
Did you remember to select "MULTITHREADED DLL" for the runtime-lib on the "code generation" project-settings page? Kitty Cat said: Doesn't mean much. MSVC is probably trying to pull in a Windows header from a "standard" header, which pulls in windows.h.
On MSVC6 this is not the case, when you create an empty win32 app. --- 0xDB | @dennisbusch_de --- |
Rick
Member #3,572
June 2003
|
OK, it's tinyXML doing it. Ran a since int main() with allegro and it worked, and as soon as I included tinyxml.h I get that error. So what should I do with tinyXML to get around this, while still keeping cross-platform code? [edit] #if defined( DEBUG ) && defined( _MSC_VER ) #include <windows.h> #define TIXML_LOG OutputDebugString #else #define TIXML_LOG printf #endif
[edit] ======================================================== |
ReyBrujo
Moderator
January 2001
|
Include <winalleg.h> instead of <windows.h> in tynixml. -- |
Wetimer
Member #1,622
November 2001
|
Allegro.h probably defines ALLEGRO_H or something. You could use #ifdefs to detect that and include winalleg.h if allergo.h has been included already. <code>if(Windows.State = Crash) Computer.halt();</code> |
Kitty Cat
Member #2,815
October 2002
|
#include <allegro.h> #ifdef ALLEGRO_WINDOWS #include <winalleg.h> // tinyXML hack #endif #include <tinyxml.h> ...
-- |
Rick
Member #3,572
June 2003
|
Quote: Include <winalleg.h> instead of <windows.h> in tynixml. That doesn't help if I'm not creating a non allegro program does it? Anyway I just did: #if defined( DEBUG ) && defined( _MSC_VER ) #include <allegro.h> #include <winalleg.h> #include <windows.h> #define TIXML_LOG OutputDebugString #else #define TIXML_LOG printf #endif and it work. Thanks all. ======================================================== |
Neil Walker
Member #210
April 2000
|
tinyXML works fine with VC6. Here is my main header file: #include <string> #include <map> #include <vector> #include <sstream> #include <stdio.h> #include <time.h> #include <math.h> #include <allegro.h> #ifdef _WIN32 #include <winalleg.h> //allow tinyXML to include windows.h #endif #include "extern/tinyxml_minimum/tinyxml.h" Is this what you are doing as you have to have the winalleg.h entry. Neil. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Rick
Member #3,572
June 2003
|
Quote: tinyXML works fine with VC6. I know, it when you use tinyXML, VC6, and allegro together when you get the problem. It won't compile as is. ======================================================== |
Neil Walker
Member #210
April 2000
|
Observe the #include<allegro.h> entry, that is why I'm posting here as I use allegro and tinyxml and vc6 Are you including allegro, then winalleg then tinyxml, in that order? Neil. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Rick
Member #3,572
June 2003
|
Quote:
#ifdef _WIN32
I understand that, but you said: ======================================================== |
|
1
2
|