Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Is Allegro C or C++?

This thread is locked; no one can reply to it. rss feed Print
Is Allegro C or C++?
Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I compiled ex_prim.c with mingw32-g++ after fixing two incompatible pointer assignments on lines 579 and 600 of the 5.1.9 release, but isn't that kind of funny? I thought the standard for Allegro programs was C99 but that fails to build (missing def of off64_t). If I compile ex_prim.c with mingw32-gcc it fails to link due to undefined references to operator new in the static allegro monolith which is explained by gcc not linking to libstdc++.

So what is Allegro these days? Is it C or C++? And how does that affect exporting symbols to other languages? How do you deal with the name mangling?

AJKproductions
Member #15,860
January 2015

I am using visual studio 2013, and allegro 5.0.10. I think it is c++, however that might just be the version I downloaded...
This is on the getting started wiki wiki page "If you want to use Allegro, you should be able to work comfortably with a computer and know the basics of programming in C or C++ either using an IDE or though the command line of your operating system. If you do not know how to program yet then please refer to the section Learn C or C++.". Hope this helped

pkrcel
Member #14,001
February 2012

Allegro is C90 strict EXCEPT a handful of files for D3D and DSOUND that HAVE to be .cpp files.

`off64_t' is not defined by the C standard so...I can't tell what's wrong there....most prolly your MINGW <sys/types.h> has something wonky in there?

Also, off64_t type MIGHT not be defined since you are on a 32-bit system, and in that case it is defined only on a certain set of conditions.

I can't tell why it's looking after that, since Allegro should handle off_t instead IIRC but I can't really tell to be honest.

Anyway what I get when building (albeit the 64-bit version) is a C dll (also for the addons).

It is unlikely that Google shares your distaste for capitalism. - Derezo
If one had the eternity of time, one would do things later. - Johan Halmén

Thomas Fjellstrom
Member #476
June 2000
avatar

The api is C, but the windows code uses C++ in the Direct3d driver to ease the implementation. The C D3D/DX apis are a horrible pain, or so I hear.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Go to: