Allegro - 'pkg-config' doesn't work

1k views Asked by At

I have problem compiling code from https://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial/Displays on CodeBlocks:

#define ALLEGRO_STATICLINK
#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;
}

Compiler gives error "undefined reference" for each "al_" function. I found "solution" (Allegro in Ubuntu: undefined reference to `al_install_system' & Compiling C++ code with allegro 5 and g++), but now compiler gives error g++.exe: error: 'pkg-config: No such file or directory. How can I fix that?

//EDIT: CodeBlocks generated build command: g++.exe -o bin\Debug\Obvi.exe obj\Debug\Main.o 'pkg-config --libs allegro-5.0.10' ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\liballegro-5.0.10-static-mt.a ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\libvorbisfile-1.3.2-static-mt.a ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\libvorbis-1.3.2-static-mt.a ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\libdumb-0.9.3-static-mt.a ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\libFLAC-1.2.1-static-mt.a ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\libfreetype-2.4.8-static-mt.a ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\libogg-1.2.1-static-mt.a ..\..\libs\allegro-5.0.10-mingw-4.7.1-tdm\lib\libzlib-1.2.5-static-mt.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libgdiplus.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libuuid.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libkernel32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libwinmm.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libpsapi.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libopengl32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libglu32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libuser32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libcomdlg32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libgdi32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libshell32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libole32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libadvapi32.a ..\..\..\TDM-GCC-64\x86_64-w64-mingw32\lib\libws2_32.a

0

There are 0 answers