To:
djgpp@delorie.com (Djgpp)
This is a trick about compiling Allegro programs that use #include <stdint.h>
I was getting the following errors:
i586-pc-msdosdjgpp-gcc -Wall -O2 -g -fcommon -c -o src/bullet.o src/bullet.c
In file included from /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/allegro/internal/alconfig.h:66,
from /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/allegro/base.h:41,
from /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/allegro.h:25,
from src/bullet.c:1: /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:22:21: error: duplicate 'signed'
22 | typedef signed char int8_t;
| ^~~~~~ /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:22:21: error: two or more data types in declaration specifiers
22 | typedef signed char int8_t;
| ^~~~~~ /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:23:23: error: duplicate 'unsigned'
23 | typedef unsigned char uint8_t;
| ^~~~~~~ /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:23:23: error: two or more data types in declaration specifiers
23 | typedef unsigned char uint8_t;
| ^~~~~~~ /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:29:26: error: duplicate 'signed'
29 | typedef signed short int int16_t;
| ^~~~~~~ /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:29:26: error: duplicate 'short'
29 | typedef signed short int int16_t;
| ^~~~~~~ /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:30:28: error: duplicate 'unsigned'
30 | typedef unsigned short int uint16_t;
| ^~~~~~~~ /usr/local/djgpp/i586-pc-msdosdjgpp/sys-include/stdint.h:30:28: error: duplicate 'short'
30 | typedef unsigned short int uint16_t;
Depending a bit on the order of my #include.
I discovered that if I add to CFLAGS: -DALLEGRO_HAVE_STDINT_H
Then this problem goes away, becaue Allegro, rather than guessing types,
would use #include , so definition are not made 2 times anymore
causing theses errors.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)