1

In trying to get Allegro (A C++ game programming library) to work with a very simple C++ application in Ubuntu 12.04, I am unable to get the program to compile with the allegro header definitions. It returns the error allegro.h - no such file or directory found. I tried running a pkg-config to find the proper linker command, but that didn't help in compilation.

I am almost certain it is installed correctly at this point. I tried using a pkg-config --cflags --libs allegro-5.0 for the include file paths, none of which worked when using in the g++ compile line.

Thanks in advance.

Taylor Bishop
  • 479
  • 2
  • 5
  • 18
  • Have you tried to `export PKG_CONFIG_PATH=/path/to/pkgfiles`? Or something like `PKG_CONFIG_PATH=/path/dir make` if you are using make? the pkg-config lists the lib among the list of handled packages? `pkg-config --cflags liballegro` what outputs? ... – ShinTakezou Apr 24 '13 at 06:34
  • So your current problem is compiling. Linking comes when that one is solved. Have you tried setting INCLUDE or adding `-I/path/to/allegro/headers` to the compiler flags? – Axel Apr 24 '13 at 06:37
  • pkg-config with --cflags returns a -I, -L and -lallegro, I tried all three of them in the g++ compile line and it still says it cannot find the header file. – Taylor Bishop Apr 24 '13 at 06:52

1 Answers1

0

Running a pkg-config --cflags --libs allegro-5.0 told me wrong on the include path. It told me to use -I/usr/local/include and after some digging into that folder, I found that the include path is -I/usr/local/include/allegro5 instead. It is compiling fine now.

Taylor Bishop
  • 479
  • 2
  • 5
  • 18