Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Having issues with the install

This thread is locked; no one can reply to it. rss feed Print
Having issues with the install
Timothy Wilson
Member #16,093
October 2015

Greetings.
I will just get right to the point with my issue. I will give a brief overview of my setup, then I will explain the methods that I have used to attempt the install, and lastly I will explain the issue that I am having.

I am running windows 10, using Microsoft visual studio 2015, and programming in C++.

To install I did a few things. What I did was download the 4.5.0 MINGW version, and extract to a temp file that I created. After this I copied the bin and pasted the files to C:Windows, then proceeded to copy the lib and include files and pasted those inside of their respective folders in sysWOW>VC>.

The issue that I am having is every time I compile the sample code:
_____________________________________________________________________
#include <stdio.h>
#include <allegro5/allegro.h>

int main(int argc, char **argv){

ALLEGRO_DISPLAY *display = NULL;

if(!al_init()) {
fprintf(stderr, "failed to initialize allegro!\n");
return -1;
}

display = al_create_display(640, 480);
if(!display) {
fprintf(stderr, "failed to create display!\n");
return -1;
}

al_clear_to_color(al_map_rgb(0,0,0));

al_flip_display();

al_rest(10.0);

al_destroy_display(display);

return 0;
}
____________________________________________________________

the same exact error continually pops up saying no such allegro.h exists, and cannot find allegro.h

I am willing to do whatever it takes to get this running, Ive been making games within the MinGW compiling screen [the black screen] and theyve been pretty decent. I am so excited that I can start to learn actual ways to program like this without compromising a lot of space and whatnot.
Thank you so much!
-TJW ;D

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I will just get right to the point with my issue. I will give a brief overview of my setup, then I will explain the methods that I have used to attempt the install, and lastly I will explain the issue that I am having.

I am running windows 10, using Microsoft visual studio 2015, and programming in C++.

To install I did a few things. What I did was download the 4.5.0 MINGW version, and extract to a temp file that I created. After this I copied the bin and pasted the files to C:Windows, then proceeded to copy the lib and include files and pasted those inside of their respective folders in sysWOW>VC>.

The issue that I am having is every time I compile the sample code:
_____________________________________________________________________
#include <stdio.h>
#include <allegro5/allegro.h>

First, you can't mix versions made for MinGW and versions made for MSVC2015. They are totally different compilers and are not compatible with each other.

See the Allegro 5.1.12 release page for information where to get binaries for MSVC 2015, unless you want to compile with MinGW.
https://www.allegro.cc/forums/thread/615781/1016896#target

Second, you should not just be stuffing the bin, include, and lib folders just anywhere. There are settings in MSVC for setting include and linker folder paths that you should set up for each project, or make a template for. If you're really using MinGW then from a command line you would use these commands :

mingw32-g++ -Wall -o MyProgram.exe -Ic:\Allegro5112\include MyProgram.cpp -Lc:\Allegro5112\lib -lallegro_monolith-debug.dll

-Isets\the\include\path
-Lsets\the\linker\path
-llinkes_a_library
-o Output file name
MyProgram.cpp source file
-Wall turns on (most)all warnings

In MSVC++2010, which I assume is still similar to 2015 in enough ways to be useful, you set the Project properties by right-clicking on the project in the solution explorer and select the Properties sub-menu. Then you go to the entry on the left for VC++ directories - you'll want to edit the values and add in the path to your include folder for allegro under include directories and then set the library directories to your lib folder. Then in the Linker -> Input tab, select Additional dependencies and edit it and add the .lib files you're using.

Timothy Wilson
Member #16,093
October 2015

Thanks, will try today and will post results.
-TJW

Go to: