Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Compiling Allegro5 with cygwin and g++

This thread is locked; no one can reply to it. rss feed Print
Compiling Allegro5 with cygwin and g++
sieryf
Member #15,666
June 2014
avatar

Hello!

I wanna compile allegro5 program to work under cygwin as it's the only place I go being at windows c:. Anyways, I extract include and lib allegro files as at Unix and my make generated command looks like:

g++ -o DevRPG ../src/*.cpp -std=c++11 -I/lib/liballegro* -L/lib -lallegro `pkg-config --libs allegro-4.0 allegro_image-5.0 allegro_font-5.0`

And I specify PKG_CONFIG_PATH as "/lib/ usr/include".
However I'm getting this pkg-config errors:

#SelectExpand
1Package allegro-4.0 was not found in the pkg-config search path. 2Perhaps you should add the directory containing `allegro-4.0.pc' 3to the PKG_CONFIG_PATH environment variable 4No package 'allegro-4.0' found 5Package allegro_image-5.0 was not found in the pkg-config search path. 6Perhaps you should add the directory containing `allegro_image-5.0.pc' 7to the PKG_CONFIG_PATH environment variable 8No package 'allegro_image-5.0' found 9Package allegro_font-5.0 was not found in the pkg-config search path. 10Perhaps you should add the directory containing `allegro_font-5.0.pc' 11to the PKG_CONFIG_PATH environment variable 12No package 'allegro_font-5.0' found

Also and fatal error inside almngw32.h about direct.h header:

#SelectExpand
13In file included from /usr/include/allegro5/internal/alconfig.h:37:0, 14 from /usr/include/allegro5/base.h:50, 15 from /usr/include/allegro5/allegro.h:26, 16 from ../src/main.cpp:28: 17/usr/include/allegro5/platform/almngw32.h:23:20: fatal error: direct.h: No such file or directory 18 #include <direct.h>

Did anyone try to build it this way before? Thank you and I pass out for today. Maybe gonna come up with some more reasonable solution tomorrow.

SiegeLord
Member #7,827
October 2006
avatar

You have a typo in your pkg-config command, and either way you don't need the .0 bit of it, it's just allegro-5 etc.

As for the other error... it's not clear to me why it's using almngw32.h if you're in Cygwin... did you compile Allegro yourself?

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

sieryf
Member #15,666
June 2014
avatar

SiegeLord said:

You have a typo in your pkg-config command, and either way you don't need the .0 bit of it, it's just allegro-5 etc.

So I correct my g++ command:

g++ -o DevRPG ../src/*.cpp -std=c++11 -I/usr/include/allegro5 -L/lib -lallegro `pkg-config --libs allegro-5 allegro_image-5 allegro_font-5`

But still error message looks the same, just this time it says:

[...]
No package 'allegro-5' found
[...]

etc.

Quote:

As for the other error... it's not clear to me why it's using almngw32.h if you're in Cygwin

I don't know either :/.

Quote:

...did you compile Allegro yourself?

I'm using allegro 5.0.9 as the software I'm compiling been written a while ago. I did not compile allegro, just copy lib, and include into /lib and /usr/include.. should I compile the bin somehow?

This code been written under windows and it should work linked just with 'liballegro-5.0.9-monolith-mt.a' and 'liballegro-5.0.9-monolith-mt-debug.a'.

SiegeLord
Member #7,827
October 2006
avatar

If the code had been already designed for Windows, you're probably best off using MSYS2 to compile it.

Either way, for Cygwin you'll need to recompile Allegro for it.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Go to: