Code::Blocks 12.11 not working with Allegro 5

I have been trying to install allegro 5 with my Code::Blocks for over a week now. I have poured over this wiki article twice (uninstalling and reinstalling all three each time) :
http://wiki.allegro.cc/index.php?title=Windows_Vista,_Code%3a%3aBlocks_10.05_and_Allegro_5

When running a simple test to see if it would work both attempts resulted in the same error. I figured it was because it was a little dated. So after searching and searching I found this article:

http://www.cppgameprogramming.com/newforums/viewtopic.php?f=5&t=1965

I followed all steps to the dot and once again I had the same exact problem. Here is the code I ran all three times just to see if the files could be located without issue:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

#include <iostream>
#define ALLEGRO_STATICLINK
#include <allegro.h>

using namespace std;


int main()
{
    cout << "hello";

    return 0;
}


all attempts resulted in the same problem when I click "build". A new tab will appear titled "allegro.h" with an error message at the bottom stating:

fatal error: allegro5/base.h: No such file or directory

I am at a complete loss as to what to do. I am very new to programming so please excuse my ignorance and be patient with me. I really have tried everything that I can think of and any help would be immensely appreciated. This is seriously the only thing that is stopping me from programming.


Last edited on
closed account (NUj6URfi)
Try using:

 
using namespace std;


After your includes.
You should know by now(if you are willing to get to graphics :) ), that cout can be found in std namespace.
So either do as toad1359 suggests(which is bad in a long run), or explicitly say what std do you take.
 
std::cout << "Hello" << std::endl;

Cheers!
Ugh... How embarrassing... I'm so sorry :S I started learning programming using C so I suppose I'm still used to C's syntax. That obviously fixed my second problem, so thank you(: But I'm still having the same problem with installing allegro. It's still saying that allegro5/base.h is missing even though I can see it inside the include folder.

When I click on the base.h file to open it, an error window pops up saying, "There was a problem sending the command to the program" But continues to open it in Code::Blocks. I've downloaded the Allegro zip straight from the Allegro.cc website so I would think that if the file was corrupt, more people would be having the same problem as me. But clearly that isn't the case so I'm pretty sure it's some step I have missed.
Check out some Allegro tutorials. You probably have to give linker some flags. For example, when I use SDL, even if I include it - it won't be found until I
a) Show compiler where to look for headers
b) add SDL flags to linker(in SDL case it's -lSDL2 , and few more flags).

Good luck!
I've been having the same problem with the base.h file. Can't figure it out.
I've been thinking about this problem for a few days now. The base.h file is recognized in my actual main file, but not in the allegro.h file that was made when I first ran it. Do I have to stick a #include <path_to_base.h> in my allegro.h file? Would that work?
bump

and happy new year
Topic archived. No new replies allowed.