473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Compilling allegro.h & windows.h

Hi,

my program is using both allegro.h and windows.h, but during compilling
it i'm getting a lot of errors like "conflicts with previous
declaration typedef struct BITMAP BITMAP". Problem is only with BITMAP
type... Have can i compile this??

Greets,
peter_k

Feb 8 '06 #1
6 3446
pk*******@gmail.com wrote:
Hi,

my program is using both allegro.h and windows.h, but during compilling
it i'm getting a lot of errors like "conflicts with previous
declaration typedef struct BITMAP BITMAP". Problem is only with BITMAP
type... Have can i compile this??


I don't know what allegro.h is, and what windows.h is.

Perhaps you should ask on a newsgroup where these files are topical.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Feb 8 '06 #2
On Wed, 08 Feb 2006 12:33:41 +0000, Ben Pope
<be***************@gmail.com> wrote:
pk*******@gmail.com wrote:
my program is using both allegro.h and windows.h, but during compilling
it i'm getting a lot of errors like "conflicts with previous
declaration typedef struct BITMAP BITMAP". Problem is only with BITMAP
type... Have can i compile this??


I don't know what allegro.h is, and what windows.h is.
Perhaps you should ask on a newsgroup where these files are topical.


This is the expected (avoidance of an) answer in c.l.c++.
The question however is: How do you handle name conflicts between
libraries
- that have no namespace and
- for which you cannot alter the source code?

An interesting question, IMHO.

Best wishes,
Roland Pibinger
Feb 8 '06 #3
Roland Pibinger wrote:
On Wed, 08 Feb 2006 12:33:41 +0000, Ben Pope
<be***************@gmail.com> wrote:
pk*******@gmail.com wrote:
my program is using both allegro.h and windows.h, but during compilling
it i'm getting a lot of errors like "conflicts with previous
declaration typedef struct BITMAP BITMAP". Problem is only with BITMAP
type... Have can i compile this?? I don't know what allegro.h is, and what windows.h is.
Perhaps you should ask on a newsgroup where these files are topical.


This is the expected (avoidance of an) answer in c.l.c++.


It's not avoidance. Either the entire code (including headers) should
be posted (which may or may not be appropriate), a snipped down version
(again, probably not appropriate) or it should be posted where those
files are topical.
The question however is: How do you handle name conflicts between
libraries
- that have no namespace and
- for which you cannot alter the source code?

An interesting question, IMHO.


Interesting it might be.

However, I can only assume that windows.h is the windows.h that I know,
although it hasn't been specified as such, it *could* be user defined.

I really have absolutely have no idea what allegro.h is, again, there
may be a file in the Windows API that has the same name, or it might be
part of another API.

Either way, these are both files which are platform/compiler/library
specific. If they have been used together before, then I would go to a
place where people who use the API more often, they are more likely to
know the answer to the name clash.

Back to the new topic you created, perhaps:
namespace allegro {
# include "allegro.h"
}

Would do it, that's pure speculation and if the library doesn't include
namespaces, then I very much doubt that identifiers are qualified to an
extent where that would come close to working.

Maybe some preprocessor trickery, include file, undo trickery. I don;t
know what the problems are.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Feb 8 '06 #4

Ben Pope wrote in message <43**********************@taz.nntpserver.com>...

I really have absolutely have no idea what allegro.h is, ....


FYI:

Allegro is a cross-platform library intended for use in computer games
and other types of multimedia programming. It was initially conceived on
the Atari ST, but that platform sadly died during childbirth. After a
brief stay with Borland C, it was adopted by the fantastic djgpp
compiler, where it grew to maturity. In the fullness of time it gave
birth to children of its own, who went to live in such exotic locations
as DirectX and the X Server, but the entire family is now back together
again, living in harmony as a single portable entity. How about that for
a mixture of metaphors? :-)

A wide range of extension packages and add-on modules are also available,
which can be found in the "Library Extensions" section of the Allegro
website, http://www.talula.demon.co.uk/allegro/.
[note: this is from a 2001 doc, so, Google if this link is not invalid.]
Another library of the same type is "Crystal Space". These have been around
for over 6 years minimum [before 1996 for Allegro].

You do not have to write a game to find these libraries useful!

[ note: Do NOT ask questions about these libraries in this NG. Go to one of
the games NGs, or a link on their sites. ]
--
Bob R
POVrookie
Feb 10 '06 #5
BobR wrote:
Ben Pope wrote in message <43**********************@taz.nntpserver.com>...
I really have absolutely have no idea what allegro.h is, ....


FYI:

Allegro is a cross-platform library intended for use in computer games
and other types of multimedia programming. It was initially conceived on
the Atari ST, but that platform sadly died during childbirth. After a


Oooh, now I feel nostalgic. My first computer. I started programming
with it when I copied the BBC micro worm game with STOS 15 years ago.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Feb 10 '06 #6

pk*******@gmail.com wrote in message
<11*********************@g47g2000cwa.googlegroups. com>...
Hi,
my program is using both allegro.h and windows.h, but during compilling
it i'm getting a lot of errors like "conflicts with previous
declaration typedef struct BITMAP BITMAP". Problem is only with BITMAP
type... Have can i compile this??
Greets,
peter_k


AHAH! Found it!

For windows, you need to include "winalleg.h" right after "allegro.h". That
re-defs the struct BITMAP, then #undefs it (huh?).
Look through that header, there is a conditional to include "windows.h".

Anyway, try that and see what you get. And read the Allegro "readme.xxx" for
your compiler.

Further discussion about Allegro is discouraged since it is OT in this NG.
--
Bob R
POVrookie
Feb 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Karol | last post by:
I wonted to write programs with allegro library under Windows so I have downloaded Dev-c++, allegro library, mingw32 and dx70 for mingw. I configured allegro under mingw32 and installed Dev-c++. I...
3
by: bissatch | last post by:
Hi I am considering compilling a list of XHTML complient websites that can be fully accessable using a handheld device that relies on standard coding. Does anybody know if such a directory...
1
by: HugoScripts | last post by:
hi there, as i said i'm trying to compile a simple program that uses allegro, it's a small thing, indeed my goal was just to start using allegro, but until now i'm unable even to compile my simple...
1
by: K. | last post by:
Witam! Mam nietypowe, a moze i typowe pytanie.... Napisalem od poczatku do konca strone internetowa w darmowym jezyku PHP nt. muzycznych List Przebojow. Program najbardziej bylby przydatny dla...
3
by: lumpybanana247 | last post by:
I'm guessing this is a stupid question, but this won't compile in Dev-C++(Bloodshed) #include <allegro.h> int main(){ allegro_init(); install_keyboard(); set_gfx_mode(...
3
PieCook
by: PieCook | last post by:
Error message: "The application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem." Basically, I recently purchased a game programming...
10
by: Firecore | last post by:
Anyone here familiar with the allegro game library? I have some code that does not work: //This is a small test for allegro #include <allegro.h> #define WHITE makecol(255, 255, 255)
1
by: drsmooth | last post by:
i am trying to get the allegro graphics library to work on my computer, im using visual c++ 6, i downloaded the binary version and copied the files to the right directories but then when i compile...
4
by: silverleaf | last post by:
I'm starting to learn how to use the Allegro library with C++ on my own. My compiler is MSVisual C++ 6.0. The book I am learning out of is "Game Programming All In One, Third Edition" by Jonathan...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.