I've built Allegro 5.1.x while back. Linux/Ubuntu.
I ran make. I ran sudo make install.
ldconfig -p | grep allegro
Results in:
However,
allegro-config --libs --cflags
Results in:
-I/usr/include -L/usr/lib/x86_64-linux-gnu -lalleg
Either way, I can't get G++ to link the most basic of programs. It can't find the library. I recall previously I "got around it" by hardcoding every applicable library with -I and -L but that is a mess and I can't find my previous workaround. So instead of starting over, I imagine it'd be better to fix the problem overall.
To be clear, this should compile, right?
g++ main.cpp -o main `allegro-config --cflags --libs`
[edit]
Perhaps that's A4. Per the docs, this should work:
g++ main.cpp -o main `pkg-config --cflags --libs allegro-5.1 allegro_acodec-5.1 allegro_audio-5.1 allegro_color-5.1 allegro_dialog-5.1 allegro_font-5.1 allegro_image-5.1 allegro_main-5.1 allegro_memfile-5.1 allegro_physfs-5.1 allegro_primitives-5.1 allegro_ttf-5.1` --std=c++11
But my PKG_CONFIG_PATH env variable was missing. I added /usr/local/lib, but still fails.
]]>
pkg-config retrieves information about packages from special metadata files. These files are named after the package, and has a .pc extension. On
most systems, pkg-config looks in /usr/lib/pkgconfig, /usr/share/pkgconfig, /usr/local/lib/pkgconfig and /usr/local/share/pkgconfig for these files.
It will additionally look in the colon-separated (on Windows, semicolon-separated) list of directories specified by the PKG_CONFIG_PATH environment
variable.
So, it already should look in /usr/local/lib/pkgconfig (on "most systems" at least). And if not, then the path to set PKG_CONFIG_PATH to would be /usr/local/lib/pkgconfig and not /usr/local/lib.
]]>Interesting!
Removing the .1 and just using:
g++ main.cpp -o main `pkg-config --cflags --libs allegro-5` --std=c++11
Successfully compiles and links!
In my usr/local/lib/pkgconfig directory there are only files named for Allegro-5. Should there be ones for Allegro-5.1?
]]>It's not supported to have both 5.1 and 5.0 installed at the same time. allegro-5 pkgconfig file refers to the latest version you've installed. Indeed, we used to append the sub version to those files, but our Debian packagers suggested we drop it, as that simplifies build system upkeep. The only reason we even have a 5 there is because there's also Allegro 4.
]]>So I ran sudo apt-get remove with all allegro5 libs (there were only a couple).
Those pkgconfig files still exist. I can still compile successfully using pkgconfig --cflags --libs allegro5 which reports:
-I/usr/local/include -L/usr/local/lib -lallegro
ldconfig -p still shows the same... I think the .so files are symbolic links to .so.5.11 libs.
[edit]
Looks like all that was removed was Allegro 4.
]]>